#2619: include Ellipitca (reader) in Einstein Toolkit
Reporter: Roland Haas
Status: open
Milestone:
Version:
Type: enhancement
Priority: major
Component:
Comment (by Roland Haas):
You would add:
```
LIBDIRS = /path/to/LIB_DIRS
LIBS = elliptica_id_reader
```
Could you provide that make output as described here [http://einsteintoolkit.org/support.html#general-guidelines-for-questions](h…
The closest equivalent is LORENE \(which would be the library\) and Meudon\_Bin\_NS \(the reader\).
If you have an existing code to look at and would like to take a look, that might help
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2619/include-ellipitca…
#2619: include Ellipitca (reader) in Einstein Toolkit
Reporter: Roland Haas
Status: open
Milestone:
Version:
Type: enhancement
Priority: major
Component:
Comment (by Pedro Espino):
Hi Roland, thank you for the guidance. We were able to write an ExternalLibraries thorn for the library in question and to compile the toolkit with this thorn by specifying the aforementioned options \(INC\_DIRS, LIB\_DIRS, and LIBS\). However, when we try to compile the separate reader thorn along with this ExternalLibrary, the compilation is facing an issue in the linking stage. Specifically, we would compile the reader code \(currently being ported to a thorn\) using this library using the following command:
gcc -o idr idr.c -fopenmp -I/path/to/INC\_DIRS -L/path/to/LIB\_DIRS **-lelliptica\_id\_reader -Wl,-rpath,/path/to/LIB\_DIRS -lm**
We have tried including the linker options \(**-lelliptica\_id\_reader -Wl,-rpath,/path/to/LIB\_DIRS -lm**\) in LDFLAGS and in the LIBS environment variables during compilation, but we are still running into a compilation error during the linking stage. Is there some way to have to toolkit use these linking options to compile the reader thorn specifically?
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2619/include-ellipitca…
#2619: include Ellipitca (reader) in Einstein Toolkit
Reporter: Roland Haas
Status: open
Milestone:
Version:
Type: enhancement
Priority: major
Component:
Comment (by Roland Haas):
Ideally the library would become an ExternalLibrary \(same as say LORENE [https://github.com/einsteinToolkit/externalLibraries-lorene](https://github…) and the reader thorn would REQUIRE it \(like Meudon\_Bin\_NS [https://bitbucket.org/einsteintoolkit/einsteininitialdata/src/master/Meudon… in file configuration.ccl\).
This has the advantage that multiple different ID readers can use the same ExternalLibrarry eg for BBH or BNS or BHNS initial data. Those should not be all handled by a single thorn since eg the BNS or BHNS reader will need to provide data in thorn HydroBase which would not be active for a pure vacuum run.
If the library cannot be incorporated as an ExternalLibrary \(eg b/c it requires use of C\+\+ features not allowed in C\+\+11 or Fortran newer than Fortran 2008\) then you could have the ID thorns take `FOO_DIR` etc option list variables the way an ExternalLibrary thorn would do. However this would mean that a user who would like to compile in multiple different ID thorns all using Elliptica’s library would have to, potentially, set multiple option list variables with identical values.
On the technical level, you can tell the build system which library to link against and the path to find is using configuration.ccl by adding a \([http://einsteintoolkit.org/usersguide/UsersGuide.html#x1-53000C1.2.3](http://einsteintoolkit.org/usersguide/UsersGuide.html#x1-53000C1.2.3)\) block
```
PROVIDES <My_Capability>
{
SCRIPT <My_ConfigScript>
LANG <My_Language>
}
```
where `My_ConfigScript` has to produce output that adheres to the syntax described here: [http://einsteintoolkit.org/usersguide/UsersGuide.html#x1-194000D2.5.1](http…
For a library that cannot be compiled from source you can pattern this after what is done in ExternalLbraries/pthreads \(this is fine even if you have actual Cactus code in `src`/\) which looks like what you can find here \([https://github.com/EinsteinToolkit/ExternalLibraries-pthreads](https://github.com/EinsteinToolkit/ExternalLibraries-pthreads)\): [https://github.com/EinsteinToolkit/ExternalLibraries-pthreads/blob/master/s… The important bit are the `MAKE_DEFINITION` \(to set Makefile variables that other thorns can use\) and `INCLUDE_DIRECTORY`, `LIBRARY_DIRECTORY`, `LIBRARY` \(to tell Cactus what `-L`, `-I` and `-l` options to produce\) blocks:
```
echo "BEGIN MAKE_DEFINITION"
echo "PTHREADS_DIR = ${PTHREADS_DIR}"
echo "PTHREADS_INC_DIRS = ${PTHREADS_INC_DIRS}"
echo "PTHREADS_LIB_DIRS = ${PTHREADS_LIB_DIRS}"
echo "PTHREADS_LIBS = ${PTHREADS_LIBS}"
echo "END MAKE_DEFINITION"
echo 'INCLUDE_DIRECTORY $(PTHREADS_INC_DIRS)'
echo 'LIBRARY_DIRECTORY $(PTHREADS_LIB_DIRS)'
echo 'LIBRARY $(PTHREADS_LIBS)'
```
Hope this helps.
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2619/include-ellipitca…
#2619: include Ellipitca (reader) in Einstein Toolkit
Reporter: Roland Haas
Status: open
Milestone:
Version:
Type: enhancement
Priority: major
Component:
Comment (by Alireza R.):
Hi @{557058:59e031ba-9bb5-4298-a472-7b99d0ae6f22} ,
I have a question: we need to link a library for the reader. I don’t know how where and how to specify the path and name to the library. Please give me an example file. Thanks!
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2619/include-ellipitca…