Giter Club home page Giter Club logo

Comments (2)

thfabian avatar thfabian commented on August 22, 2024

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!).

    1. Change to the directory serialbox2/examples/fortran/perturbation
    cd  serialbox2/examples/fortran/perturbation
    1. Create a build directory
    mkdir build
    cd build
    1. 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 pass SERIALBOX_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 up make 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.

Let me know if there are any further issues.

from serialbox.

adamryczkowski avatar adamryczkowski commented on August 22, 2024

OK. Everything works. Thanks!

from serialbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.