Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC")
MESSAGE("Found compiler: ${CMAKE_Fortran_COMPILER_ID}")
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -ffree-line-length-none")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -g -O -Wuninitialized -fbounds-check -finit-local-zero")
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS} -g -O -Wuninitialized -fbounds-check -finit-local-zero -Wall")
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS} -O3")
elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp")
Expand Down
60 changes: 37 additions & 23 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
#!/bin/bash
#
# Define how to build the libraries and executables:
BUILD_TYPE=Debug
if [[ -z "${BUILD_TYPE}" ]]; then
BUILD_TYPE="Debug"
fi
echo "Using BUILD_TYPE = $BUILD_TYPE"

if [[ -z "${ENABLE_PFUNIT}" ]]; then
ENABLE_PFUNIT=ON
fi
echo "Using ENABLE_PFUNIT = $ENABLE_PFUNIT"

Fortran_COMPILER=gfortran
LIBSUFFIX="so"
GENERATOR_FLAGS=""

if [[ "$OSTYPE" == "linux-gnu" ]]; then
LIBSUFFIX="so"
elif [[ "$OSTYPE" == "darwin"* ]]; then
Expand All @@ -23,24 +33,28 @@ git submodule update --init --recursive
# Build pFUnit #
# #
################################################################################
cd pFUnit || exit || exit
# Create the build directory if it does not exist
if [[ ! -d "build" ]]; then
mkdir build
if [[ "$ENABLE_PFUNIT" == "ON" ]]; then
cd pFUnit || exit
# Create the build directory if it does not exist
if [[ ! -d "build" ]]; then
mkdir build
else
rm -rf build/*
fi
cd build || exit
echo "Updating cmake"
export PFUNIT_DIR=..//pFUnit/build/installed
export FC=$Fortran_COMPILER
cmake -DSKIP_MPI=yes "$GENERATOR_FLAGS" ../
echo "Building pFUnit"
cmake --build .
cmake --install .
cd ../ || exit
echo "Leaving pFUnit"
cd ../ || exit
else
rm -rf build/*
echo "ENABLE_PFUNIT is 'OFF'. Skipping. Set to 'ON' to add it."
fi
cd build || exit || exit
echo "Updating cmake"
export PFUNIT_DIR=..//pFUnit/build/installed
export FC=$Fortran_COMPILER
cmake -DSKIP_MPI=yes "$GENERATOR_FLAGS" ../
echo "Building pFUnit"
cmake --build .
cmake --install .
cd ../ || exit || exit
echo "Leaving pFUnit"
cd ../ || exit || exit
################################################################################
# #
# Build libslam #
Expand All @@ -52,10 +66,10 @@ if [[ ! -d "build" ]]; then
else
rm -rf build/*
fi
cd build || exit || exit
cd build || exit
echo "Executing cmake"

cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_Fortran_COMPILER=$Fortran_COMPILER -DENABLE_OpenMP_SUPPORT=ON -DENABLE_POSTGRESQL_SUPPORT=ON -DENABLE_PFUNIT=ON "$GENERATOR_FLAGS" ../
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_Fortran_COMPILER=$Fortran_COMPILER -DENABLE_OpenMP_SUPPORT=ON -DENABLE_POSTGRESQL_SUPPORT=ON -DENABLE_PFUNIT="$ENABLE_PFUNIT" "$GENERATOR_FLAGS" ../
echo "Building libslam"
cmake --build .
cmake --install .
Expand All @@ -64,8 +78,8 @@ if [[ $? -ne 0 ]]; then
exit $?
fi
echo "Manually preparing 'lib' and 'include' directories"
cd ../ || exit || exit
ln -sf build/include include || exit || exit
ln -sf build/lib lib || exit || exit
cd ../ || exit
ln -sf build/include include || exit
ln -sf build/lib lib || exit
echo "Leaving libslam"
echo "Done"
echo "Done with $BUILD_TYPE build"
23 changes: 16 additions & 7 deletions pFUnittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,33 @@
include_directories(${CMAKE_Fortran_MODULE_DIRECTORY})
message("pfunit: ${CMAKE_Fortran_MODULE_DIRECTORY}")
#Build the executables for testing
add_pfunit_ctest (slamtime_tests
add_pfunit_ctest (slam_time_test
TEST_SOURCES test_slamtime.pf
LINK_LIBRARIES slam-Fortran)



add_pfunit_ctest (slamreduction_tests
add_pfunit_ctest (slam_reduction_test
TEST_SOURCES test_slamreduction.pf
LINK_LIBRARIES slam-Fortran)

add_pfunit_ctest (slamlinAlgebra_tests
add_pfunit_ctest (slam_linAlgebra_test
TEST_SOURCES test_slamlinAlgebra.pf
LINK_LIBRARIES slam-Fortran)

add_pfunit_ctest (slammath_tests
add_pfunit_ctest (slam_math_test
TEST_SOURCES test_slammath.pf
LINK_LIBRARIES slam-Fortran)

add_pfunit_ctest (slamastroconv_tests
add_pfunit_ctest (slam_astro_conversions_test
TEST_SOURCES test_slamastroconv.pf
LINK_LIBRARIES slam-Fortran)

add_pfunit_ctest (slam_interpolation_test
TEST_SOURCES test_slamInterpolation.pf
LINK_LIBRARIES slam-Fortran)

add_pfunit_ctest (slam_randomNumber_test
TEST_SOURCES test_slamrandomNumber.pf
LINK_LIBRARIES slam-Fortran)
add_pfunit_ctest (slam_strings_test
TEST_SOURCES test_slamstrings.pf
LINK_LIBRARIES slam-Fortran)
Loading
Loading