Repository navigation
WIP: Attempt to build on NERSC Perlmutter #19
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
base: SOLPS_develop
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,10 @@ | ||
| # Test whether necessary variables are set | ||
| GR_ROOT ?= /global/project/projectdirs/atom/atom-install-cori/solps-libs/lib_gfortran | ||
| GLI_HOME ?= /global/project/projectdirs/atom/atom-install-cori/solps-libs/lib_gfortran | ||
| SOLPSLIB ?= ${SOLPSTOP}/lib/${HOST_NAME}.${COMPILER} | ||
| GR_ROOT ?= ${SOLPSLIB}/gr | ||
| GLI_HOME ?= ${SOLPSLIB}/gli/src/gks | ||
| LD_GR ?= -L${GR_ROOT} -lgr | ||
| LD_GKS ?= -L${GLI_HOME} -lgks | ||
| LD_NAG ?= -L${SOLPSLIB} -lblas -llapack | ||
| LD_GKS ?= -L${SOLPSLIB}/gli/src/gks -lgks | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment above. |
||
|
|
||
| CPP = cpp -traditional | ||
| CPP = CC -traditional | ||
| FC = ftn | ||
| CC = cc | ||
|
|
||
|
|
@@ -27,6 +25,18 @@ LDLIBS = | |
|
|
||
| INCMOD = -I | ||
|
|
||
| # Build with JSON if present | ||
| ifeq ($(shell `pkg-config --exists json-fortran`; echo $$?),0) | ||
| JSON_INC ?= $(shell pkg-config json-fortran --cflags) | ||
| LD_JSON ?= $(shell pkg-config json-fortran --libs) | ||
| else | ||
|
hrdoktorx marked this conversation as resolved.
Resolved
|
||
| ifndef SOLPS_CPP | ||
| DEFINES += -DNO_JSON | ||
| endif | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||
| endif | ||
|
|
||
| INCLUDE += ${JSON_INC} | ||
|
|
||
| #!!!Local Variables: | ||
| #!!! mode: Makefile | ||
| #!!! End: | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,26 @@ set(EIRENE_POSTFIX "" CACHE STRING "EIRENE output names postfix") | |
| # - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| # This is a bit convoluted but allows for some user error in the JSON library location | ||
| # First check for user defined paths | ||
| if(LibJSON) | ||
| # Ask pkg-config first, unless the user has pointed at a specific installation | ||
| if(NOT LibJSON AND NOT DEFINED ENV{JSONF_LIB_DIR}) | ||
| find_package(PkgConfig QUIET) | ||
| if(PKG_CONFIG_FOUND) | ||
| pkg_check_modules(PC_JSONFORTRAN QUIET json-fortran) | ||
| if(PC_JSONFORTRAN_FOUND) | ||
| find_library(JSONFORTRAN_LIBRARY NAMES ${PC_JSONFORTRAN_LIBRARIES} | ||
| HINTS ${PC_JSONFORTRAN_LIBRARY_DIRS} NO_DEFAULT_PATH) | ||
| endif() | ||
| endif() | ||
| endif() | ||
|
|
||
| if(PC_JSONFORTRAN_FOUND AND JSONFORTRAN_LIBRARY AND EXISTS "${PC_JSONFORTRAN_INCLUDE_DIRS}/json_module.mod") | ||
| message(STATUS " Found LibJSON with pkg-config. Version: " ${PC_JSONFORTRAN_VERSION}) | ||
| set(LibJSON ${JSONFORTRAN_LIBRARY}) | ||
| set(jsonfortran_INCLUDE_DIRS ${PC_JSONFORTRAN_INCLUDE_DIRS}) | ||
| set(jsonfortran_FOUND TRUE) | ||
| message(STATUS " LibJSON: " ${LibJSON}) | ||
| # Then check for user defined paths | ||
| elseif(LibJSON) | ||
| message(STATUS " Searching for user defined LibJSON. Found " ${LibJSON} ) | ||
| if(IS_DIRECTORY ${LibJSON}) | ||
| if((EXISTS "${LibJSON}/libjsonfortran.a" OR EXISTS "${LibJSON}/libjsonfortran.so")) | ||
|
|
@@ -78,7 +97,7 @@ if(LibJSON) | |
| set(LibJSON "${LibJSON}/libjsonfortran.a") | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably split this up so that an existing shared object then leads to forcing the linking against the statically linked library, which conda does not provide.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. |
||
| set(jsonfortran_FOUND TRUE) | ||
| else() | ||
| message(WARNING "JSON Library libjsonfortran.a NOT found at " ${LibJSON}) | ||
| message(WARNING "JSON Library ljsonfortran NOT found at " ${LibJSON}) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change the name here?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I am linking against ljsonfortran.so (potentially)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand the drop of the extension. But you were only looking for the existence of |
||
| endif() | ||
| else() # Assume the library is included in the path | ||
| if(EXISTS ${LibJSON}) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as per the comment below.
SOLPSLIBwill only exist if one is compiling inside a SOLPS environment. ButGRandGLIare separate module that come form outside SOLPS-ITER, so they have their own workspace and that is where one should expect to find the libraries.