Hi, I am trying to compile Amber22 with netcdf and netcdf-fortran from OpenHPC modules and I am getting this error. As far as I can tell, the packages should be fine, e.f. PNetCDF that I used is compiling without problem in Amber. These are the modules:
-------------------------------- /opt/ohpc/pub/moduledeps/gnu12-openmpi4 ---------------------------------
netcdf-fortran/4.6.0 (L) netcdf/4.9.0 (L) phdf5/1.14.0 (L) pnetcdf/1.12.3 (L)
------------------------------------- /opt/ohpc/pub/moduledeps/gnu12 -------------------------------------
hdf5/1.14.0 openmpi4/4.1.5 (L)
gnu12/12.2.0 (L)
run_cmake command:
cmake $AMBER_PREFIX/amber22_src \
-DCMAKE_INSTALL_PREFIX=/apps/amber/22-custom \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DPRINT_PACKAGING_REPORT=TRUE \
-DCOMPILER=GNU \
-DCHECK_UPDATES=TRUE \
-DDOWNLOAD_MINICONDA=TRUE \
-DBUILD_PYTHON=TRUE \
-DMPI=TRUE \
-DCUDA=TRUE \
-DINSTALL_TESTS=FALSE \
-DBUILD_QUICK=FALSE \
-DTRUST_SYSTEM_LIBS=TRUE \
-DNetCDF_INCLUDES_F77=${NETCDF_FORTRAN_DIR}/include \
-DNetCDF_LIBRARIES_F77=${NETCDF_FORTRAN_DIR}/lib/libnetcdff.so \
-DNetCDF_INCLUDES_F90=${NETCDF_FORTRAN_DIR}/include \
-DNetCDF_LIBRARIES_F90=${NETCDF_FORTRAN_DIR}/lib/libnetcdff.so \
-DNetCDF_LIBRARIES=${NETCDF_DIR}/lib/libnetcdf.so \
-DPnetCDF_LIBRARY=${PNETCDF_DIR}/lib/libpnetcdf.a \
-DPnetCDF_INCLUDE_DIR=${PNETCDF_INC} \
The error is:
-- Performing Test NetCDF_F90_WORKS
-- Performed Test NetCDF_F90_WORKS - Failed
-- NetCDF's Fortran 90 interface was found on your system, but it wasn't possible to compile programs using it. The module file in use is "/opt/ohpc/pub/libs/gnu12/openmpi4/netcdf-fortran/4.6.0/include/netcdf.mod", and the library is located at "/opt/ohpc/pub/libs/gnu12/openmpi4/netcdf-fortran/4.6.0/lib/libnetcdff.so" The most common cause of this error is that the module was created by a different compiler or compiler version than what's currently in use. Check CMakeError.log for more details.
-- Could NOT find NetCDF (missing: NetCDF_C_WORKS NetCDF_LIBRARIES)
....
In CMakeError I see something like this:
Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_bc335/fast && /usr/bin/gmake -f CMakeFiles/cmTC_bc335.dir/build.make CMakeFiles/cmTC_bc335.dir/build
gmake[1]: Entering directory '/apps/src/amber/22-ambertools23/amber22_src/build/CMakeFiles/CMakeTmp'
Building Fortran object CMakeFiles/cmTC_bc335.dir/src.F90.o
/opt/ohpc/pub/compiler/gcc/12.2.0/bin/gfortran -DNetCDF_F90_WORKS -fPIE -I/opt/ohpc/pub/libs/gnu12/openmpi4/netcdf-fortran/4.6.0/include -c /apps/src/amber/22-ambertools23/amber22_src/build/CMakeFiles/CMakeTmp/src.F90 -o CMakeFiles/cmTC_bc335.dir/src.F90.o
Linking Fortran executable cmTC_bc335
/opt/ohpc/pub/utils/cmake/3.24.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bc335.dir/link.txt --verbose=1
/opt/ohpc/pub/compiler/gcc/12.2.0/bin/gfortran -DNetCDF_F90_WORKS CMakeFiles/cmTC_bc335.dir/src.F90.o -o cmTC_bc335
/usr/bin/ld: CMakeFiles/cmTC_bc335.dir/src.F90.o: in function `MAIN__':
src.F90:(.text+0x5d): undefined reference to `__netcdf_MOD_nf90_strerror'
collect2: error: ld returned 1 exit status
Any help would be appreciated.
Thanks
PharmDr. Martin Juhás, Ph.D.
Univerzita Karlova, Farmaceutická fakulta v Hradci Králové
Katedra farmaceutické chemie a farmaceutické analýzy
Akademika Heyrovského 1203/8, 500 05 Hradec Králové
Tel.: +420 495 067 272
E-mail: juhasm.faf.cuni.cz<mailto:juhasm.faf.cuni.cz>
[cid:image001.jpg.01DAA09C.10276310]
Upozornění: Není-li v této zprávě výslovně uvedeno jinak, má tato e-mailová zpráva nebo její přílohy pouze informativní charakter. Tato zpráva ani její přílohy v žádném ohledu Univerzitu Karlovu k ničemu nezavazují. Text této zprávy nebo jejích příloh není návrhem na uzavření smlouvy, ani přijetím případného návrhu na uzavření smlouvy, ani jiným právním jednáním směřujícím k uzavření jakékoliv smlouvy a nezakládá předsmluvní odpovědnost Univerzity Karlovy. Obsahuje-li tento e-mail nebo některá z jeho příloh osobní údaje, dbejte při jeho dalším zpracování (zejména při archivaci) souladu s pravidly evropského nařízení GDPR.
Disclaimer: If not expressly stated otherwise, this e-mail message (including any attached files) is intended purely for informational purposes and does not represent a binding agreement on the part of Charles University. The text of this message and its attachments cannot be considered as a proposal to conclude a contract, nor the acceptance of a proposal to conclude a contract, nor any other legal act leading to concluding any contract; nor does it create any pre-contractual liability on the part of Charles University. If this e-mail or any of its attachments contains personal data, please be aware of data processing (particularly document management and archival policy) in accordance with Regulation (EU) 2016/679 of the European Parliament and of the Council on GDPR.
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue May 07 2024 - 08:00:02 PDT