Skip to content

Commit bf1bf1d

Browse files
committed
AL: First commit of the fully open source version of COOLFluiD
1 parent 60cce29 commit bf1bf1d

File tree

8,450 files changed

+2424354
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,450 files changed

+2424354
-0
lines changed

CMakeLists.txt

+469
Large diffs are not rendered by default.

CTestConfig.cmake

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## This file should be placed in the root directory of your project.
2+
## Then modify the CMakeLists.txt file in the root directory of your
3+
## project to incorporate the testing dashboard.
4+
5+
set(CTEST_PROJECT_NAME "coolfluid2")
6+
set(CTEST_NIGHTLY_START_TIME "01:00:00 GMT")
7+
8+
set(CTEST_DROP_METHOD "http")
9+
set(CTEST_DROP_SITE "coolfluidsrv.vki.ac.be")
10+
set(CTEST_DROP_LOCATION "/cdash/submit.php?project=coolfluid2")
11+
set(CTEST_DROP_SITE_CDASH TRUE)

README.md

+48
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,51 @@ COOLFluiD
22
=========
33

44
The object-oriented HPC platform for CFD, plasma and multi-physics simulations whose development started in 2002 at the Von Karman Institute for Fluid Dynamics is finally open.
5+
6+
#########################################################################
7+
# #
8+
# This is some information to get started with COOLFluiD #
9+
# (more detailed info will be available on the website, once restored). #
10+
# #
11+
#########################################################################
12+
13+
In order to install COOLFluiD you first need to install:
14+
15+
mpi (e.g. openmpi, mpich, mvapich)
16+
petsc (3.3 or 3.4.2)
17+
boost (1.42 or 1.54)
18+
curl (optional)
19+
parmetis (4.0.3)
20+
21+
Once you have done that, you must set the correct path inside the coolfluid.conf file (see examples in tools/conf/).
22+
23+
./prepare.pl --config-file=CONF_FILE --mods-update (download all required modules)
24+
./prepare.pl --config-file=CONF_FILE --build=BUILD_MODE (configures build system and creates makefiles)
25+
26+
Note that if CONF_FILE=coolfluid.conf (default) you can skip "--config-file=CONF_FILE".
27+
28+
If you don't have errors, you should be ready to compile now:
29+
30+
cd basebuild_dir/BUILD_MODE (see what you specified in CONF_FILE for "basebuild_dir")
31+
32+
make -jN
33+
34+
When the compilation is finished, your executable is:
35+
36+
basebuild_dir/BUILD_MODE/src/Solver/coolfluid_solver
37+
38+
In order o run, you need to have also the
39+
40+
basebuild_dir/BUILD_MODE/src/Solver/coolfluid_solver.xml
41+
42+
inside the same directory. It is convenient to just create soft links to
43+
coolfluid_solver* in the directory TESTDIR where collfluid needs to be run :
44+
45+
cd TESTDIR
46+
ln -sf basebuild_dir/BUILD_MODE/src/Solver/coolfluid_solver* .
47+
48+
To run:
49+
50+
mpirun -np NPROC ./coolfluid_solver --scase TESTCASE_PATH/testcase.CFcase
51+
52+
TESTCASE_PATH must be "./" if the .CFcase file is in the current directory.

cmake/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# install the cmake files
2+
FILE(GLOB cmakeFiles "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake")
3+
4+
INSTALL( FILES ${cmakeFiles} DESTINATION cmake )
5+

cmake/CMakeTestCUDACompiler.cmake

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Modified from CMakeTestCUDACompiler.cmake
2+
3+
# This file is used by EnableLanguage in cmGlobalGenerator to
4+
# determine that that selected CUDA compiler can actually compile
5+
# and link the most basic of programs. If not, a fatal error
6+
# is set and cmake stops processing commands and will not generate
7+
# any makefiles or projects.
8+
IF(NOT CMAKE_CUDA_COMPILER_WORKS)
9+
MESSAGE(STATUS "Check for working CUDA compiler: ${CMAKE_CUDA_COMPILER}")
10+
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCUDACompiler.cu
11+
"#ifndef __cplusplus\n"
12+
"# error \"The CMAKE_CUDA_COMPILER is not a C++ compiler\"\n"
13+
"#endif\n"
14+
"int main(int argc, char* argv[])\n"
15+
"{ return argc-1;}\n")
16+
TRY_COMPILE(CMAKE_CUDA_COMPILER_WORKS ${CMAKE_BINARY_DIR}
17+
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCUDACompiler.cu
18+
OUTPUT_VARIABLE OUTPUT)
19+
SET(CUDA_TEST_WAS_RUN 1)
20+
ENDIF(NOT CMAKE_CUDA_COMPILER_WORKS)
21+
22+
IF(NOT CMAKE_CUDA_COMPILER_WORKS)
23+
MESSAGE(STATUS "Check for working CUDA compiler: ${CMAKE_CUDA_COMPILER} -- broken")
24+
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
25+
"Determining if the CUDA compiler works failed with "
26+
"the following output:\n${OUTPUT}\n\n")
27+
MESSAGE(FATAL_ERROR "The CUDA compiler \"${CMAKE_CUDA_COMPILER}\" "
28+
"is not able to compile a simple test program.\nIt fails "
29+
"with the following output:\n ${OUTPUT}\n\n"
30+
"CMake will not be able to correctly generate this project.")
31+
ELSE(NOT CMAKE_CUDA_COMPILER_WORKS)
32+
IF(CUDA_TEST_WAS_RUN)
33+
MESSAGE(STATUS "Check for working CUDA compiler: ${CMAKE_CUDA_COMPILER} -- works")
34+
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
35+
"Determining if the CUDA compiler works passed with "
36+
"the following output:\n${OUTPUT}\n\n")
37+
ENDIF(CUDA_TEST_WAS_RUN)
38+
SET(CMAKE_CUDA_COMPILER_WORKS 1 CACHE INTERNAL "")
39+
ENDIF(NOT CMAKE_CUDA_COMPILER_WORKS)

cmake/CheckCompilerFeatures.cmake

+196
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
LOG ( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++" )
2+
LOG ( "Checking compiler features:" )
3+
LOG ( "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++" )
4+
5+
#######################################################################################
6+
7+
LOG ( "+++++ Checking sizes of types" )
8+
CHECK_TYPE_SIZE("void *" CF_SIZEOF_PTR)
9+
CHECK_TYPE_SIZE(char CF_SIZEOF_CHAR)
10+
CHECK_TYPE_SIZE(short CF_SIZEOF_SHORT)
11+
CHECK_TYPE_SIZE(int CF_SIZEOF_INT)
12+
CHECK_TYPE_SIZE(long CF_SIZEOF_LONG)
13+
CHECK_TYPE_SIZE(float CF_SIZEOF_FLOAT)
14+
CHECK_TYPE_SIZE(double CF_SIZEOF_DOUBLE)
15+
CHECK_TYPE_SIZE("long double" CF_SIZEOF_LONG_DOUBLE)
16+
# CHECK_TYPE_SIZE(int8_t CF_SIZEOF_INT8_T)
17+
# CHECK_TYPE_SIZE(uint8_t CF_SIZEOF_UINT8_T)
18+
# CHECK_TYPE_SIZE(int_least8_t CF_SIZEOF_INT_LEAST8_T)
19+
# CHECK_TYPE_SIZE(uint_least8_t CF_SIZEOF_UINT_LEAST8_T)
20+
# CHECK_TYPE_SIZE(int_fast8_t CF_SIZEOF_INT_FAST8_T)
21+
# CHECK_TYPE_SIZE(uint_fast8_t CF_SIZEOF_UINT_FAST8_T)
22+
# CHECK_TYPE_SIZE(int16_t CF_SIZEOF_INT16_T)
23+
# CHECK_TYPE_SIZE(uint16_t CF_SIZEOF_UINT16_T)
24+
# CHECK_TYPE_SIZE(int_least16_t CF_SIZEOF_INT_LEAST16_T)
25+
# CHECK_TYPE_SIZE(uint_least16_t CF_SIZEOF_UINT_LEAST16_T)
26+
# CHECK_TYPE_SIZE(int_fast16_t CF_SIZEOF_INT_FAST16_T)
27+
# CHECK_TYPE_SIZE(uint_fast16_t CF_SIZEOF_UINT_FAST16_T)
28+
# CHECK_TYPE_SIZE(int32_t CF_SIZEOF_INT32_T)
29+
# CHECK_TYPE_SIZE(uint32_t CF_SIZEOF_UINT32_T)
30+
# CHECK_TYPE_SIZE(int_least32_t CF_SIZEOF_INT_LEAST32_T)
31+
# CHECK_TYPE_SIZE(uint_least32_t CF_SIZEOF_UINT_LEAST32_T)
32+
# CHECK_TYPE_SIZE(int_fast32_t CF_SIZEOF_INT_FAST32_T)
33+
# CHECK_TYPE_SIZE(uint_fast32_t CF_SIZEOF_UINT_FAST32_T)
34+
# CHECK_TYPE_SIZE(int64_t CF_SIZEOF_INT64_T)
35+
# CHECK_TYPE_SIZE(uint64_t CF_SIZEOF_UINT64_T)
36+
# CHECK_TYPE_SIZE(int_least64_t CF_SIZEOF_INT_LEAST64_T)
37+
# CHECK_TYPE_SIZE(uint_least64_t CF_SIZEOF_UINT_LEAST64_T)
38+
# CHECK_TYPE_SIZE(int_fast64_t CF_SIZEOF_INT_FAST64_T)
39+
# CHECK_TYPE_SIZE(uint_fast64_t CF_SIZEOF_UINT_FAST64_T)
40+
CHECK_TYPE_SIZE(size_t CF_SIZEOF_SIZE_T)
41+
# CHECK_TYPE_SIZE(ssize_t CF_SIZEOF_SSIZE_T)
42+
# CHECK_TYPE_SIZE(off_t CF_SIZEOF_OFF_T)
43+
# CHECK_TYPE_SIZE(__int64 CF_SIZEOF___INT64)
44+
CHECK_TYPE_SIZE("long long" CF_SIZEOF_LONG_LONG)
45+
46+
MATH ( EXPR CF_OS_BITS "${CF_SIZEOF_PTR} * 8")
47+
48+
#######################################################################################
49+
50+
LOG ( "+++++ Checking MPI support" )
51+
INCLUDE(CheckMPI)
52+
53+
#######################################################################################
54+
55+
# LOG ( "+++++ Checking for pre compiled header support" )
56+
# INCLUDE(CheckPreCompiledHeaderSupport)
57+
58+
#######################################################################################
59+
60+
LOG ( "+++++ Checking C++ compiler has namespaces" )
61+
CHECK_CXX_SOURCE_COMPILES (
62+
" namespace lolo { struct popo { int i; }; }
63+
using namespace lolo;
64+
int main(int argc, char* argv[])
65+
{
66+
lolo::popo p;
67+
popo pp;
68+
return 0;
69+
}
70+
"
71+
CF_CXX_HAVE_NAMESPACES)
72+
IF( NOT CF_CXX_HAVE_NAMESPACES )
73+
MESSAGE ( FATAL_ERROR "C++ compiler does not support namespaces" )
74+
ENDIF()
75+
76+
#######################################################################################
77+
78+
LOG ( "+++++ Checking for __FUNCTION__ support" )
79+
INCLUDE(CheckFunctionDef)
80+
81+
#######################################################################################
82+
83+
LOG ( "+++++ Checking for restrict keyword" )
84+
INCLUDE(CheckRestrictKeyword)
85+
86+
#######################################################################################
87+
88+
# LOG ( "+++++ Checking for explicit template support" ) # output in macro
89+
INCLUDE ( CheckExplicitInstantiation )
90+
91+
#######################################################################################
92+
93+
LOG ( "+++++ Checking for mmap support" ) # check memory mmap functions
94+
# check memory mmap functions
95+
CHECK_FUNCTION_EXISTS(mmap CF_HAVE_MMAP)
96+
CHECK_FUNCTION_EXISTS(munmap CF_HAVE_MUNMAP)
97+
CHECK_FUNCTION_EXISTS(mremap CF_HAVE_MREMAP)
98+
IF(CF_HAVE_MMAP AND CF_HAVE_MUNMAP AND CF_HAVE_MREMAP)
99+
SET( CF_HAVE_ALLOC_MMAP 1 CACHE BOOL "MemoryAllocator_MMAP can be built")
100+
ENDIF()
101+
102+
#######################################################################################
103+
104+
LOG ( "+++++ Checking for vsnprintf function" ) # check memory mmap functions
105+
CHECK_FUNCTION_EXISTS(vsnprintf CF_HAVE_VSNPRINTF)
106+
107+
#######################################################################################
108+
109+
LOG ( "+++++ Checking for erfc function" )
110+
CHECK_CXX_SOURCE_COMPILES (
111+
" #include <cmath>
112+
int main (int argc, char* argv[]) { erfc (0.); }
113+
"
114+
CF_HAVE_MATH_ERFC )
115+
116+
#######################################################################################
117+
118+
LOG ( "+++++ Checking for asinh function" )
119+
CHECK_CXX_SOURCE_COMPILES (
120+
" #include <cmath>
121+
int main (int argc, char* argv[]) { asinh (0.); }
122+
"
123+
CF_HAVE_MATH_ASINH )
124+
125+
#######################################################################################
126+
127+
LOG ( "+++++ Checking for acosh function" )
128+
CHECK_CXX_SOURCE_COMPILES (
129+
" #include <cmath>
130+
int main (int argc, char* argv[]) { acosh (0.); }
131+
"
132+
CF_HAVE_MATH_ACOSH )
133+
134+
#######################################################################################
135+
136+
LOG ( "+++++ Checking for atanh function" )
137+
CHECK_CXX_SOURCE_COMPILES (
138+
" #include <cmath>
139+
int main (int argc, char* argv[]) { atanh (0.); }
140+
"
141+
CF_HAVE_MATH_ATANH)
142+
143+
#######################################################################################
144+
145+
LOG ( "+++++ Checking for the POSIX unistd.h header" ) # check unistd.h
146+
CHECK_INCLUDE_FILE( unistd.h CF_HAVE_UNISTD_H )
147+
148+
#######################################################################################
149+
150+
# check for c++ abi, ussually present in GNU compilers
151+
LOG ( "+++++ Checking for cxxabi" )
152+
153+
CHECK_CXX_SOURCE_COMPILES (
154+
"#include <cxxabi.h>
155+
int main(int argc, char* argv[])
156+
{ char * type; int status;
157+
char * r = abi::__cxa_demangle(type, 0, 0, &status);
158+
return 0;
159+
}"
160+
CF_HAVE_CXXABI_H)
161+
162+
#######################################################################################
163+
164+
# check for time headers
165+
LOG ( "+++++ Checking for headers with time information" )
166+
CHECK_INCLUDE_FILE(sys/time.h CF_HAVE_SYS_TIME_H)
167+
CHECK_INCLUDE_FILE(time.h CF_HAVE_TIME_H)
168+
CHECK_INCLUDE_FILE(sys/resource.h CF_HAVE_SYS_RESOURCE_H)
169+
CHECK_FUNCTION_EXISTS(gettimeofday CF_HAVE_GETTIMEOFDAY)
170+
171+
#######################################################################################
172+
# Win32 specific
173+
#######################################################################################
174+
175+
IF(WIN32)
176+
177+
LOG ( "+++++ Checking for the Win32 windows.h header" ) # check windows.hfor Windows API
178+
CHECK_INCLUDE_FILE_CXX(windows.h CF_HAVE_WINDOWSH)
179+
LOG ( "+++++ Checking for the Win32 dbghelp.h header" ) # check dbghelp.h for call stack
180+
CHECK_INCLUDE_FILE_CXX(dbghelp.h CF_HAVE_DBGHELPH)
181+
LOG ( "+++++ Checking for the Win32 psapi.h header" ) # check psapi.h for memory info
182+
CHECK_INCLUDE_FILE_CXX(psapi.h CF_HAVE_PSAPIH)
183+
184+
ENDIF()
185+
186+
#######################################################################################
187+
# UNIX specific
188+
#######################################################################################
189+
190+
IF(UNIX)
191+
192+
LOG ( "+++++ Checking for the dlfcn.h header" ) # for dlopen
193+
CHECK_INCLUDE_FILE_CXX(dlfcn.h CF_HAVE_DLOPEN)
194+
195+
ENDIF()
196+
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Test whether the compiler supports explicit template instantiation.
2+
# This actually creates a class template instantiation in one source
3+
# file and tries to use it from another. This approach checks that
4+
# both the instantiation syntax and symbol linkage is handled
5+
# properly.
6+
7+
MAKE_DIRECTORY(${COOLFluiD_BINARY_DIR}/CMakeTmp/CheckExplicitInstantiation)
8+
STRING(ASCII 35 POUND)
9+
WRITE_FILE(
10+
${COOLFluiD_BINARY_DIR}/CMakeTmp/CheckExplicitInstantiation/CMakeLists.txt
11+
"PROJECT(EXPLICIT)\n"
12+
"ADD_LIBRARY(A A.cxx)\n"
13+
"ADD_EXECUTABLE(B B.cxx)\n"
14+
"TARGET_LINK_LIBRARIES(B A)\n"
15+
)
16+
WRITE_FILE(
17+
${COOLFluiD_BINARY_DIR}/CMakeTmp/CheckExplicitInstantiation/A.h
18+
"${POUND}ifndef A_h\n"
19+
"${POUND}define A_h\n"
20+
"template <class T> class A { public: static T Method(); };\n"
21+
"${POUND}endif\n"
22+
)
23+
WRITE_FILE(
24+
${COOLFluiD_BINARY_DIR}/CMakeTmp/CheckExplicitInstantiation/A.cxx
25+
"${POUND}include \"A.h\"\n"
26+
"template <class T> T A<T>::Method() { return 0; }\n"
27+
"template class A<int>;"
28+
)
29+
WRITE_FILE(
30+
${COOLFluiD_BINARY_DIR}/CMakeTmp/CheckExplicitInstantiation/B.cxx
31+
"${POUND}include \"A.h\"\n"
32+
"int main() { return A<int>::Method(); }\n"
33+
)
34+
TRY_COMPILE( CF_CXX_SUPPORTS_EXPLICIT_TEMPLATES
35+
${COOLFluiD_BINARY_DIR}/CMakeTmp/CheckExplicitInstantiation/Build
36+
${COOLFluiD_BINARY_DIR}/CMakeTmp/CheckExplicitInstantiation
37+
EXPLICIT OUTPUT_VARIABLE OUTPUT
38+
)
39+
IF(CF_CXX_SUPPORTS_EXPLICIT_TEMPLATES)
40+
LOG( "+++++ Checking support for C++ explicit template instantiation -- yes")
41+
SET(CF_CXX_SUPPORTS_EXPLICIT_TEMPLATES ON CACHE INTERNAL "Support for C++ explict templates")
42+
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
43+
"Determining if the C++ compiler supports explict template instantiation passed with the following output:\n"
44+
"${OUTPUT}\n" APPEND)
45+
ELSE()
46+
LOG( "+++++ Checking support for C++ explicit template instantiation -- no")
47+
SET(CF_CXX_SUPPORTS_EXPLICIT_TEMPLATES OFF CACHE INTERNAL "Support for C++ explict templates")
48+
WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
49+
"Determining if the C++ compiler supports explict template instantiation failed with the following output:\n"
50+
"${OUTPUT}\n" APPEND)
51+
ENDIF()

cmake/CheckFunctionDef.cmake

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# try to compile a program
2+
CHECK_CXX_SOURCE_COMPILES (
3+
" #include <iostream>
4+
int main(int argc, char* argv[])
5+
{
6+
std::cout << __FUNCTION__ << std::endl;
7+
return 0;
8+
}"
9+
CF_HAVE_FUNCTION_DEF )

0 commit comments

Comments
 (0)