diff --git a/CMake/filepaths_default.cmake b/CMake/filepaths_default.cmake index fdc8d4e6..48a1e9cd 100644 --- a/CMake/filepaths_default.cmake +++ b/CMake/filepaths_default.cmake @@ -1,24 +1,70 @@ # default filepath locations for installed dependency files -set( NETCDF_CXX_SHARED_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" - CACHE STRING "${description}" ) +if( NOT DEFINED NETCDF_CXX_SHARED_LIB_DIR ) + + set( NETCDF_CXX_SHARED_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" + CACHE STRING "${description}" ) +else() + + set( NETCDF_CXX_SHARED_LIB_DIR ${NETCDF_CXX_SHARED_LIB_DIR} + CACHE STRING "${description}" ) +endif() + +if( NOT DEFINED NETCDF_CXX_HEADERS_DIR ) -set( NETCDF_CXX_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" - CACHE STRING "empty" ) + set( NETCDF_CXX_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" + CACHE STRING "${description}" ) +else() + + set( NETCDF_CXX_HEADERS_DIR ${NETCDF_CXX_HEADERS_DIR} + CACHE STRING "${description}" ) +endif() + +if( NOT DEFINED NETCDF_C_SHARED_LIB_DIR ) set( NETCDF_C_SHARED_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" CACHE STRING "${description}" ) +else() + +set( NETCDF_C_SHARED_LIB_DIR ${NETCDF_C_SHARED_LIB_DIR} + CACHE STRING "${description}" ) + +endif() + +if( NOT DEFINED NETCDF_C_HEADERS_DIR ) set( NETCDF_C_HEADERS_DIR "/usr/include" CACHE STRING "${description}" ) +else() +set( NETCDF_C_HEADERS_DIR ${NETCDF_C_HEADERS_DIR} CACHE STRING "${description}" ) +endif() +if( NOT DEFINED ${LIBCONFIG_CXX_LIB_DIR}) set( LIBCONFIG_CXX_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" CACHE STRING "${description}" ) +else() +set( LIBCONFIG_CXX_LIB_DIR ${LIBCONFIG_CXX_LIB_DIR} + CACHE STRING "${description}" ) +endif() +if( NOT DEFINED ${LIBCONFIG_C_LIB_DIR} ) set( LIBCONFIG_C_LIB_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" CACHE STRING "${description}" ) +else() +set( LIBCONFIG_C_LIB_DIR ${LIBCONFIG_C_LIB_DIR} + CACHE STRING "${description}" ) +endif() +if( NOT DEFINED ${LIBCONFIG_CXX_HEADERS_DIR} ) set( LIBCONFIG_CXX_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" CACHE STRING "${description}" ) - +else() +set( LIBCONFIG_CXX_HEADERS_DIR ${LIBCONFIG_CXX_HEADERS_DIR} + CACHE STRING "${description}" ) +endif() +if( NOT DEFINED ${LIBCONFIG_C_HEADERS_DIR} ) set( LIBCONFIG_C_HEADERS_DIR "/usr/lib/x86_64-linux-gnu" "/usr/lib" CACHE STRING "${description}" ) +else() +set( LIBCONFIG_C_HEADERS_DIR ${LIBCONFIG_C_HEADERS_DIR} + CACHE STRING "${description}" ) +endif() diff --git a/CMake/netcdf.cmake b/CMake/netcdf.cmake index aa51d3fc..935dcd60 100644 --- a/CMake/netcdf.cmake +++ b/CMake/netcdf.cmake @@ -1,9 +1,12 @@ # find files -# Captain! Find file: find_file( netcdf_cxx_shared_lib NAMES libnetcdf-cxx4.so libnetcdf_c++4.so HINTS ${NETCDF_CXX_SHARED_LIB_DIR} ) + +message( "Captain! netcdf_c_shared_lib: ${netcdf_c_shared_lib}" ) + +message( "Captain! netcdf_c_shared_lib dir: ${NETCDF_C_SHARED_LIB_DIR}" ) find_file( netcdf_c_shared_lib NAMES libnetcdf.so @@ -17,7 +20,6 @@ find_path( netcdf_cxx_headers NAMES netcdf HINTS ${NETCDF_CXX_HEADERS_DIR} ) -message( "netcdf_c_shared_lib: ${netcdf_c_shared_lib}" ) add_library( netcdf_cxx SHARED IMPORTED ) add_library( netcdf_c SHARED IMPORTED ) diff --git a/build.sh b/build.sh index b9506bba..7d78441f 100644 --- a/build.sh +++ b/build.sh @@ -1,12 +1,12 @@ cmake -S $1 -B $2 -G Ninja \ --D NETCDF_C_HEADERS_DIR="/home/5n4/workshop/tree/external/netcdf-c-install/include" \ --D NETCDF_CXX_HEADERS_DIR="/home/5n4/workshop/tree/external/netcdf-cxx4-install/include" \ --D NETCDF_C_SHARED_LIB_DIR="/home/5n4/workshop/tree/external/netcdf-c-install/lib" \ --D NETCDF_CXX_SHARED_LIB_DIR="/home/5n4/workshop/tree/external/netcdf-cxx4-install/lib" \ --D LIBCONFIG_C_HEADERS_DIR="/home/5n4/workshop/tree/external/libconfig_install/include" \ --D LIBCONFIG_CXX_HEADERS_DIR="/home/5n4/workshop/tree/external/libconfig_install/include" \ --D LIBCONFIG_C_LIB_DIR="/home/5n4/workshop/tree/external/libconfig_install/lib" \ --D LIBCONFIG_CXX_LIB_DIR="/home/5n4/workshop/tree/external/libconfig_install/lib" \ +-DNETCDF_C_HEADERS_DIR="/home/5n4/build_right/external/netcdf-c-install/include" \ +-DNETCDF_CXX_HEADERS_DIR="/home/5n4/build_right/external/netcdf-cxx4-install/include" \ +-DNETCDF_C_SHARED_LIB_DIR="/home/5n4/build_right/external/netcdf-c-install/lib" \ +-DNETCDF_CXX_SHARED_LIB_DIR="/home/5n4/build_right/external/netcdf-cxx4-install/lib" \ +-DLIBCONFIG_C_HEADERS_DIR="/home/5n4/build_right/external/libconfig_install/include" \ +-DLIBCONFIG_CXX_HEADERS_DIR="/home/5n4/build_right/external/libconfig_install/include" \ +-DLIBCONFIG_C_LIB_DIR="/home/5n4/build_right/external/libconfig_install/lib" \ +-DLIBCONFIG_CXX_LIB_DIR="/home/5n4/build_right/external/libconfig_install/lib" \ &> $2/cmake_output.txt ; cmake --build $2 -- -j 0 &> $2/build_output.txt diff --git a/build/clean.sh b/build/clean.sh deleted file mode 100755 index 453e3cfb..00000000 --- a/build/clean.sh +++ /dev/null @@ -1,2 +0,0 @@ -rm CMakeCache.txt -rm -r CMakeFiles diff --git a/build/make_gitr.sh b/build/make_gitr.sh deleted file mode 100755 index 0f0f12b7..00000000 --- a/build/make_gitr.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -source ../env.default.sh - -cmake -DTHRUST_INCLUDE_DIR=$THRUST_DIR \ - -DNETCDF_CXX_INCLUDE_DIR=$NETCDFCXX4INCLUDE \ - -DNETCDF_CXX_LIBRARY=$NETCDFCXX4LIB \ - -DLIBCONFIG_INCLUDE_DIR=$LIBCONFIG_INCLUDE_DIR \ - -DLIBCONFIGPP_LIBRARY=$LIBCONFIGLIB \ - -DLIBCONFIGPP_INCLUDE_DIR=$LIBCONFIG_INCLUDE_DIR \ - -DUSE_CUDA=1 \ - -DUSE_MPI=0 \ - -DUSE_DOUBLE=1 \ - .. -# -DNETCDF_CXX_INCLUDE_DIR=$NETCDFCXX4INCLUDE \ -# -DNETCDF_CXX_LIBRARY=$NETCDFLIB_CPP \ -# -DNETCDF_DIR=$NETCDFDIR \ -# -DNETCDF_INCLUDE_DIR=$NETCDFINCLUDE \ -# -DNETCDF_LIBRARY=$NETCDFLIB \ -# -DLIBCONFIGPP_LIBRARY=$LIBCONFIGLIB \ -# -DLIBCONFIGPP_INCLUDE_DIR=$LIBCONFIG_INCLUDE_DIR \ -# -DCPPFLAGS=-I${H5DIR}/include \ -# -DLDFLAGS=${H5DIR}/lib/libhdf5.dylib \ -# -DHDF5_LIBRARIES=${H5DIR}/lib/libhdf5.a \ -# -DHDF5_INCLUDE_DIRS=${H5DIR}/include \ -# -DHDF5_C_COMPILER_EXECUTABLE=${H5DIR}/bin/h5pcc \ -# -DHDF5_HL_LIBRARIES=${H5DIR}/lib/libhdf5_hl.dylib \