Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Changes for comptability as subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdiazangulo committed Apr 29, 2024
1 parent cb180a5 commit 8cd3dc0
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions set_precompiled_libraries.cmake
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
set(PRECOMPILED_DIR "${PROJECT_SOURCE_DIR}/precompiled_libraries")

if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(JSONFORTRAN_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-gcc-rls/jsonfortran/")
set(JSONFORTRAN_DIR "${PRECOMPILED_DIR}/linux-gcc-rls/jsonfortran/")
set(JSONFORTRAN_LIB ${JSONFORTRAN_DIR}libjsonfortran.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "NVHPC" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(JSONFORTRAN_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-nvhpc-rls/jsonfortran/")
set(JSONFORTRAN_DIR "${PRECOMPILED_DIR}/linux-nvhpc-rls/jsonfortran/")
set(JSONFORTRAN_LIB ${JSONFORTRAN_DIR}libjsonfortran.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(JSONFORTRAN_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intel-rls/jsonfortran/")
set(JSONFORTRAN_DIR "${PRECOMPILED_DIR}/linux-intel-rls/jsonfortran/")
set(JSONFORTRAN_LIB ${JSONFORTRAN_DIR}libjsonfortran.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(JSONFORTRAN_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intelLLVM-rls/jsonfortran/")
set(JSONFORTRAN_DIR "${PRECOMPILED_DIR}/linux-intelLLVM-rls/jsonfortran/")
set(JSONFORTRAN_LIB ${JSONFORTRAN_DIR}libjsonfortran-static.a)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(JSONFORTRAN_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/windows-intel-rls/jsonfortran/")
set(JSONFORTRAN_DIR "${PRECOMPILED_DIR}/windows-intel-rls/jsonfortran/")
set(JSONFORTRAN_LIB ${JSONFORTRAN_DIR}jsonfortran.lib)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(JSONFORTRAN_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/windows-intelLLVM-rls/jsonfortran/")
set(JSONFORTRAN_DIR "${PRECOMPILED_DIR}/windows-intelLLVM-rls/jsonfortran/")
set(JSONFORTRAN_LIB ${JSONFORTRAN_DIR}jsonfortran-static.lib)
else()
message(FATAL_ERROR "json-fortran precompiled libraries for this platform and/or compiler have not been found.")
Expand All @@ -23,27 +25,27 @@ include_directories(${JSONFORTRAN_DIR}/include/)
MESSAGE(STATUS "Using json-fortran precompiled libraries at: " ${JSONFORTRAN_DIR})

if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LAPACK_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-gcc-rls/lapack/")
set(LAPACK_DIR "${PRECOMPILED_DIR}/linux-gcc-rls/lapack/")
set(LAPACK_LIB ${LAPACK_DIR}liblapack.a)
set(BLAS_LIB ${LAPACK_DIR}libblas.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "NVHPC" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LAPACK_DIR "/opt/nvidia/hpc_sdk/Linux_x86_64/24.3/compilers/lib/")
set(LAPACK_LIB ${LAPACK_DIR}liblapack.a)
set(BLAS_LIB ${LAPACK_DIR}libblas.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LAPACK_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intel-rls/lapack/")
set(LAPACK_DIR "${PRECOMPILED_DIR}/linux-intel-rls/lapack/")
set(LAPACK_LIB ${LAPACK_DIR}liblapack.a)
set(BLAS_LIB ${LAPACK_DIR}libblas.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LAPACK_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intelLLVM-rls/lapack/")
set(LAPACK_DIR "${PRECOMPILED_DIR}/linux-intelLLVM-rls/lapack/")
set(LAPACK_LIB ${LAPACK_DIR}liblapack.a)
set(BLAS_LIB ${LAPACK_DIR}libblas.a)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(LAPACK_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/windows-intel-rls/lapack/")
set(LAPACK_DIR "${PRECOMPILED_DIR}/windows-intel-rls/lapack/")
set(LAPACK_LIB ${LAPACK_DIR}liblapack.lib)
set(BLAS_LIB ${LAPACK_DIR}libblas.lib)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(LAPACK_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/windows-intelLLVM-rls/lapack/")
set(LAPACK_DIR "${PRECOMPILED_DIR}/windows-intelLLVM-rls/lapack/")
set(LAPACK_LIB ${LAPACK_DIR}liblapack.lib)
set(BLAS_LIB ${LAPACK_DIR}libblas.lib)
else()
Expand All @@ -52,23 +54,23 @@ endif()
MESSAGE(STATUS "Using lapack precompiled libraries at: " ${LAPACK_DIR})

if (${CMAKE_Fortran_COMPILER_ID} STREQUAL "GNU" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(NGSPICE_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-gcc-rls/ngspice/")
set(NGSPICE_DIR "${PRECOMPILED_DIR}/linux-gcc-rls/ngspice/")
set(NGSPICE_LIB ${NGSPICE_DIR}libngspice.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "NVHPC" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(NGSPICE_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-gcc-rls/ngspice/")
set(NGSPICE_DIR "${PRECOMPILED_DIR}/linux-gcc-rls/ngspice/")
set(NGSPICE_LIB ${NGSPICE_DIR}libngspice.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(NGSPICE_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intel-dbg/ngspice/")
set(NGSPICE_DIR "${PRECOMPILED_DIR}/linux-intel-dbg/ngspice/")
set(NGSPICE_LIB ${NGSPICE_DIR}libngspice.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(NGSPICE_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intelLLVM-dbg/ngspice/")
set(NGSPICE_DIR "${PRECOMPILED_DIR}/linux-intelLLVM-dbg/ngspice/")
set(NGSPICE_LIB ${NGSPICE_DIR}libngspice.a)
elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM" AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(NGSPICE_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intelLLVM-rls/ngspice/")
set(NGSPICE_DIR "${PRECOMPILED_DIR}/linux-intelLLVM-rls/ngspice/")
set(NGSPICE_LIB ${NGSPICE_DIR}libngspice.a)
elseif ((${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "IntelLLVM") AND
${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(NGSPICE_DIR "${CMAKE_SOURCE_DIR}/precompiled_libraries/windows-intel-rls/ngspice/")
set(NGSPICE_DIR "${PRECOMPILED_DIR}/windows-intel-rls/ngspice/")
set(NGSPICE_LIB ${NGSPICE_DIR}ngspice.lib)
add_library(ngspice SHARED IMPORTED)
set_target_properties(ngspice PROPERTIES
Expand All @@ -86,7 +88,7 @@ if (CompileWithHDF)
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU" OR ${CMAKE_Fortran_COMPILER_ID} STREQUAL "NVHPC")
# System libraries. Install with sudo apt install libhdf5
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID MATCHES "IntelLLVM")
set(HDF5_DIR ${CMAKE_SOURCE_DIR}/precompiled_libraries/linux-intel-rls/hdf5/cmake/)
set(HDF5_DIR ${PRECOMPILED_DIR}/linux-intel-rls/hdf5/cmake/)
endif()

find_package(HDF5 REQUIRED COMPONENTS Fortran HL)
Expand Down

0 comments on commit 8cd3dc0

Please sign in to comment.