Skip to content

Commit

Permalink
Fixes (#125)
Browse files Browse the repository at this point in the history
* changes

* Replacing norm2

* changed example_build back

* Changed example_build back

* changes to example build

* Cmake test for norm2

* Changed pkg_check syntax

* Indentation and whitespace fixes

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
  • Loading branch information
cnegre authored Feb 2, 2019
1 parent 81eba73 commit 3631c96
Show file tree
Hide file tree
Showing 8 changed files with 460 additions and 398 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ set(PROJECT_VERSION
set(PROJECT_DESCRIPTION
"Progress Library "
"A library for solvers used in quantum chemistry packages")

include(GNUInstallDirs)

set(CMAKE_INSTALL_PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
Expand Down Expand Up @@ -154,6 +153,9 @@ if(SANITY_CHECK)
add_definitions(-DSANITY_CHECK)
endif()

include(${CMAKE_SOURCE_DIR}/cmake/checkFortranFunctions.cmake)
check_norm2()

add_subdirectory(src)

find_package(Doxygen)
Expand Down
25 changes: 25 additions & 0 deletions cmake/checkFortranFunctions.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Check if Fortran functions exist

macro(check_norm2)
message(STATUS "Looking for Fortran NORM2 function")
file(WRITE
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/testNorm2.f90
"
program testNorm2
real a(3)
a = 1
anorm = norm2(a)
end program testNorm2
"
)
try_compile(HAVE_NORM2
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/testNorm2.f90
)
if(HAVE_NORM2)
message(STATUS "Looking for Fortran NORM2 - found")
add_definitions(-DNORM2)
else()
message(STATUS "Looking for Fortran ${FUNCTION} - not found")
endif()
endmacro()
1 change: 0 additions & 1 deletion example_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export PROGRESS_GRAPHLIB=${PROGRESS_GRAPHLIB:=no}
export PROGRESS_TESTING=${PROGRESS_TESTING:=yes}
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
export PROGRESS_EXAMPLES=${PROGRESS_EXAMPLES:=yes}
export PROGRESS_EXAMPLES=${PROGRESS_EXAMPLES:=yes}
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:=$BML_LIB}
export EXTRA_FCFLAGS=${EXTRA_FCFLAGS:=""}
export EXTRA_LINK_FLAGS=${EXTRA_LINK_FLAGS:=""}
Expand Down
Loading

0 comments on commit 3631c96

Please sign in to comment.