Comments (2)
Hey Adam,
The example is intentionally disabled from the main CMake project as it is a stand-alone example. This means you have to use Serialbox as an external library and this example demonstrates how this is being done i.e guides you through the process of setting up CMake to link against Serialbox.
To get it working, proceed the following:
-
First you need to compile and install Serialbox with Fortran enabled (see https://eth-cscs.github.io/serialbox2/Building.html). By default, Serialbox is installed in
serialbox2/install
. Something like:git clone https://github.com/eth-cscs/serialbox2.git cd serialbox2 mkdir build cd build cmake -DSERIALBOX_ENABLE_FORTRAN=ON ../ make make install
should do the trick.
-
Now we can compile the example (or any other project which uses Serialbox for that matter). Note that this is completely decoupled from the build we did before (it only uses the installed headers and binaries!).
- Change to the directory
serialbox2/examples/fortran/perturbation
cd serialbox2/examples/fortran/perturbation
- Create a build directory
mkdir build cd build
- Now we are ready to run CMake for this example. Take a look at
examples/fortran/perturbation/CMakeLists.txt
which has a very detailed explanation on what exactly is going on and how to use CMake with Serialbox. Further, the documentation on how to use Serialbox as an external project (https://eth-cscs.github.io/serialbox2/Usage.html) may be of use. Basically the only thing you need to provide is the install location of Serialbox. For this example however, the location of Serialbox (SERIALBOX_ROOT
) is hard-coded i.e it assumes the installation of Serialbox is in../../../install
(but you can also remove this line and passSERIALBOX_ROOT
via command-line to have a more realistic environment). Now, this simply means we can run CMake in the build directory:
cmake ../
which will create all the build files directly in
serialbox2/examples/fortran/perturbation/build
and a follow upmake
will build the example. Note that for this example you need to compile Serialbox with Fortran enabled (https://eth-cscs.github.io/serialbox2/Building.html#building-the-fortran-interface) otherwise the CMake module will complain. - Change to the directory
Let me know if there are any further issues.
from serialbox.
OK. Everything works. Thanks!
from serialbox.
Related Issues (20)
- FindpFUnit.cmake missing HOT 2
- Jenkins on tave: uses gfortran instead of pgfortran for pgi HOT 1
- compare.py overwrites MetaData JSON files HOT 6
- pp_ser data directive IF condition ignored
- Decouple building of core and bindings HOT 1
- Try GridTools::c_bindings for the Fortran interface
- Serialbox2 is still depending on Boost even when using std::filesystem
- cmake_minimum_required is different
- compare.py fails when field is boolean
- Broken link in README.md (build instructions) HOT 2
- Fortran API tests are failing HOT 3
- PGI has problems linking std::experimental::filesystem
- Not possible to read data from savepoint with metadata from Fortran? HOT 10
- MacOS support
- MacOS issue with SERIALBOX_ENABLE_FORTRAN ON HOT 3
- Serialbox data versioning & backwards compatibility HOT 4
- Remove reference to old repo name
- SerialBox doesn't seem to understand "module function" or "module subroutine" syntax HOT 1
- Please add support for Serialization of Fortran classes, and subroutine arguments declared `intent(in)`. HOT 1
- Intel compiler fails to build tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serialbox.