Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing with version controlled rhybrid #5

Open
iljah opened this issue Feb 7, 2025 · 1 comment
Open

Installing with version controlled rhybrid #5

iljah opened this issue Feb 7, 2025 · 1 comment

Comments

@iljah
Copy link
Contributor

iljah commented Feb 7, 2025

Current installation instructions have mv rhybrid-master/src/ corsair-master/src/user/rhybrid which doesn't allow installing version controlled rhybrid. It would be nicer to be able to instead use e.g. mv rhybrid-master corsair-master/src/user/rhybrid or even

mv rhybrid-master corsair-master/src/user/rhybrid-master
cd corsair-master/src/user
ln -s rhybrid-master rhybrid
cd -

I'm investigating last option...

@iljah
Copy link
Contributor Author

iljah commented Feb 7, 2025

These changes allow me to use git checkout of rhybrid for installation with above symlink trick, first for corsair:

$ git diff src/Makefile 
diff --git a/src/Makefile b/src/Makefile
index ae58aa7..9805463 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -9,7 +9,7 @@ default:
        ${MAKE} "ARCH=${ARCH}" "INCS=${INCS}" -C kernel
        ${MAKE} "ARCH=${ARCH}" "INCS=${INCS}" -C user/${SIM}
 
-       ${LNK} -o corsair_${SIM} -Llib ${LIBS}
+       ${LNK} -o corsair_${SIM} -Luser/${SIM} -Llib ${LIBS}
        mv corsair_${SIM} ../
 
 clean:

Then for rhybrid:

diff --git a/src/Makefile b/src/Makefile
index 6720500..8e5f558 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -10,7 +10,7 @@ WRITE_GRID_TEMPORAL_AVERAGES := true
 USE_DETECTORS := false
 USE_SHOCKTUBE_TEST_CONFIGURATION := false
 
-include ../../../Makefile.${ARCH}
+include ../../../../Makefile.${ARCH}
 
 # Names of files that should be compiled and inserted to lib${SIM}.a:
 OBJS = detectors.o hybrid.o hybrid_propagator.o operator_userdata.o particle_accumulator.o particle_injector.o particle_species.o register_objects.o user.o
@@ -72,15 +72,15 @@ clean:
 
 lib${SIM}.a: ${OBJS}
        ${AR} r lib${SIM}.a ${OBJS}
-       ln -f -s ${CURDIR}/lib${SIM}.a -t ../../lib
+       ln -f -s ${CURDIR}/lib${SIM}.a -t ../../../lib
 
 # Dependencies
 
 override INCS+=${INC} ${INC_BOOST} ${INC_PARGRID} ${INC_VLSV} ${INC_ZOLTAN}
-override INCS+=-I../../include
+override INCS+=-I../../../include
 
-INCS_REG=${INCS} -I../../particleinjector -I../../dataoperator
-INCS_REG+=-I../../particlepropagator -I../../gridbuilder
+INCS_REG=${INCS} -I../../../particleinjector -I../../../dataoperator
+INCS_REG+=-I../../../particlepropagator -I../../../gridbuilder
 
 # Compile information passed to user.cpp
 COMPILEINFO := \""DATE: $(shell date --iso-8601=seconds)\nUSER: $(shell whoami)\nHOST: $(shell hostname)\nDIR: $(shell pwd)\nCMP: $(shell echo ${CMP})\nCXXFLAGS: $(shell echo ${CXXFLAGS})\nMATHFLAGS: $(shell echo ${MATHFLAGS})\nFLAGS: $(shell echo ${FLAGS})\nINCS: $(shell echo ${INCS})\nINCS_REG: $(shell echo ${INCS_REG})\""

Someone more familiar with corsair/rhybrid build system might find more elegant solution(s)...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant