CGAL fails to build, as part of installing mshr from source, when it looks for DOLFINTargets.cmake

152 views
Skip to first unread message

Amnon Harel

unread,
Nov 10, 2016, 11:44:38 AM11/10/16
to fenics-support
I'm trying to install dolfin with mshr on a gentoo system.
The ebuild looks useless, so I'm building from source.
With a little help I managed to checkout and build the 2016.1.0 versions of fiat, ufl, dijitso, instant, ffc, and dolfin.

BTW: preparing for the mshr build, I also installed VTK and openmpi, and ensured that gmplib and mpfr are installed.

Now trying to build mshr in its own "build" subdirectory, with "cmake .."
First attempt failed to find DOLFIN, but this is resolved with (in my bash shell):
export DOLFIN_DIR=/home/aharel/lingacom/FEniCS/git2/dolfin/build/
 
Then it find the dolfin cmake and fails with:
-- Current source dir: /home/aharel/lingacom/FEniCS/git2/mshr/3rdparty
-- Binary dir: /home/aharel/lingacom/FEniCS/git2/mshr/build
-- CGAL build type: Debug
CMake Error at /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin/DOLFINConfig.cmake:13 (include):
 include could not find load file:

   /usr/local/share/dolfin/cmake/DOLFINTargets.cmake
Call Stack (most recent call first):
 CMakeLists.txt:81 (find_package)


CMake Error at CMakeLists.txt:83 (include):
 include could not find load file:

   /usr/local/share/dolfin/cmake/UseDOLFIN.cmake
Notably, DOLFINTargets.cmake exists in /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin/CMakeFiles/Export/share/dolfin/cmake/DOLFINTargets.cmake

But dolfin's cmake, being called from CGAL's cmake from mshr's cmake, looks for it in the non-existing directory /usr/local/share/dolfin/cmake

Any help will be appreciated :-)

Benjamin Kehlet

unread,
Nov 11, 2016, 3:53:36 AM11/11/16
to Amnon Harel, fenics-support

10. nov. 2016 5.44 p.m. skrev "Amnon Harel" <harel...@gmail.com>:
>
> I'm trying to install dolfin with mshr on a gentoo system.
> The ebuild looks useless, so I'm building from source.
> With a little help I managed to checkout and build the 2016.1.0 versions of fiat, ufl, dijitso, instant, ffc, and dolfin.
>
> BTW: preparing for the mshr build, I also installed VTK and openmpi, and ensured that gmplib and mpfr are installed.
>
> Now trying to build mshr in its own "build" subdirectory, with "cmake .."
> First attempt failed to find DOLFIN, but this is resolved with (in my bash shell):
>>
>> export DOLFIN_DIR=/home/aharel/lingacom/FEniCS/git2/dolfin/build/

Is this the directory where dolfin is installer?
(It is good practice to not buildbot and install in the same directory).


>
>  
> Then it find the dolfin cmake and fails with:
>>
>> -- Current source dir: /home/aharel/lingacom/FEniCS/git2/mshr/3rdparty
>> -- Binary dir: /home/aharel/lingacom/FEniCS/git2/mshr/build
>> -- CGAL build type: Debug
>> CMake Error at /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin/DOLFINConfig.cmake:13 (include):
>>  include could not find load file:
>>
>>    /usr/local/share/dolfin/cmake/DOLFINTargets.cmake
>> Call Stack (most recent call first):
>>  CMakeLists.txt:81 (find_package)
>>
>>
>> CMake Error at CMakeLists.txt:83 (include):
>>  include could not find load file:
>>
>>    /usr/local/share/dolfin/cmake/UseDOLFIN.cmake
>
> Notably, DOLFINTargets.cmake exists in /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin/CMakeFiles/Export/share/dolfin/cmake/DOLFINTargets.cmake
>
> But dolfin's cmake, being called from CGAL's cmake from mshr's cmake, looks for it in the non-existing directory /usr/local/share/dolfin/cmake
>
> Any help will be appreciated :-)

When you have installed dolfin, try to do
source [path/to/dolfin-installation]/share/dolfin/dolfin.conf
to make sure cmake can find dolfin.
Let us know if this doesn't work.

Best regards

Benjamin Kehlet
>
> --
> You received this message because you are subscribed to the Google Groups "fenics-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fenics-suppor...@googlegroups.com.
> To post to this group, send email to fenics-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fenics-support/8f2ed992-1cb8-4331-b040-9e61075cd37f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Amnon Harel

unread,
Nov 11, 2016, 4:59:47 AM11/11/16
to Benjamin Kehlet, fenics-support
Hi Benjamin,

Thanks for your help.

I already installed dolfin, as described in my original post.

I tried your explicit recommendation, but I found a dolfin.conf only
in [path/to/dolfin-installation]/dolfin.conf, not in [path/to/dolfin-installation]/share/dolfin/dolfin.conf. So from the mshr build directory /home/aharel/lingacom/FEniCS/git2/mshr/build
I did "source /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin.conf"
Then "cmake .." which failed in the exact same manner as before.

I did not understand your first comment. I see there exists a tool called "buildbot", but you used it as a verb. Are you saying it's good practice to not (build bot && install in the same directory); or rather are you saying that it's good practice to (not build bot) && (install in the same directory)?

Anyway, I tried to cmake mshr from the dolfin build directory, but that just complains
"CMake Error: The source "/home/aharel/lingacom/FEniCS/git2/mshr/CMakeLists.txt" does not match the source "/home/aharel/lingacom/FEniCS/git2/dolfin/CMa
keLists.txt" used to generate cache.  Re-run cmake with a different source directory.
"

 thanks again,
 Amnon

> To unsubscribe from this group and stop receiving emails from it, send an email to fenics-support+unsubscribe@googlegroups.com.
> To post to this group, send email to fenics-support@googlegroups.com.

Benjamin Kehlet

unread,
Nov 11, 2016, 5:19:10 AM11/11/16
to Amnon Harel, fenics-support

11. nov. 2016 10.59 a.m. skrev "Amnon Harel" <harel...@gmail.com>:
>
> Hi Benjamin,
>
> Thanks for your help.
>
> I already installed dolfin, as described in my original post.
>
> I tried your explicit recommendation, but I found a dolfin.conf only
> in [path/to/dolfin-installation]/dolfin.conf, not in [path/to/dolfin-installation]/share/dolfin/dolfin.conf. So from the mshr build directory /home/aharel/lingacom/FEniCS/git2/mshr/build
> I did "source /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin.conf"
> Then "cmake .." which failed in the exact same manner as before.
>
> I did not understand your first comment. I see there exists a tool called "buildbot", but you used it as a verb. Are you saying it's good practice to not (build bot && install in the same directory); or rather are you saying that it's good practice to (not build bot) && (install in the same directory)?
>
> Anyway, I tried to cmake mshr from the dolfin build directory, but that just complains
> "CMake Error: The source "/home/aharel/lingacom/FEniCS/git2/mshr/CMakeLists.txt" does not match the source "/home/aharel/lingacom/FEniCS/git2/dolfin/CMa
> keLists.txt" used to generate cache.  Re-run cmake with a different source directory.
> "

Hi

No, buildbot has nothing to do with this.
What was the exact commands you used when installing dolfin?
(BTW: Is it an option for you to use docker containers? That is usually much easier than building from source manually. A lot of people, including core developers, prefer this to quickly get a FEniCS environment up and running).

Regards

Benjamin

>> > To unsubscribe from this group and stop receiving emails from it, send an email to fenics-suppor...@googlegroups.com.
>> > To post to this group, send email to fenics-...@googlegroups.com.

Anders Logg

unread,
Nov 11, 2016, 5:51:50 AM11/11/16
to Benjamin Kehlet, Amnon Harel, fenics-support
Yes, I recommend following these instructions: http://fenics-containers.readthedocs.io/en/latest/developing.html

This should work out of the box and give you an optimized hassle-free FEniCS installation.

--
Anders


fre 11 nov. 2016 kl 11:19 skrev Benjamin Kehlet <benj...@simula.no>:

11. nov. 2016 10.59 a.m. skrev "Amnon Harel" <harel...@gmail.com>:
>

> Hi Benjamin,
>
> Thanks for your help.
>
> I already installed dolfin, as described in my original post.
>
> I tried your explicit recommendation, but I found a dolfin.conf only
> in [path/to/dolfin-installation]/dolfin.conf, not in [path/to/dolfin-installation]/share/dolfin/dolfin.conf. So from the mshr build directory /home/aharel/lingacom/FEniCS/git2/mshr/build
> I did "source /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin.conf"
> Then "cmake .." which failed in the exact same manner as before.
>
> I did not understand your first comment. I see there exists a tool called "buildbot", but you used it as a verb. Are you saying it's good practice to not (build bot && install in the same directory); or rather are you saying that it's good practice to (not build bot) && (install in the same directory)?
>
> Anyway, I tried to cmake mshr from the dolfin build directory, but that just complains
> "CMake Error: The source "/home/aharel/lingacom/FEniCS/git2/mshr/CMakeLists.txt" does not match the source "/home/aharel/lingacom/FEniCS/git2/dolfin/CMa
> keLists.txt" used to generate cache.  Re-run cmake with a different source directory.
> "

Hi

No, buildbot has nothing to do with this.
What was the exact commands you used when installing dolfin?
(BTW: Is it an option for you to use docker containers? That is usually much easier than building from source manually. A lot of people, including core developers, prefer this to quickly get a FEniCS environment up and running).

Regards

Benjamin

>

>> > To unsubscribe from this group and stop receiving emails from it, send an email to fenics-suppor...@googlegroups.com.
>> > To post to this group, send email to fenics-...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "fenics-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fenics-suppor...@googlegroups.com.
To post to this group, send email to fenics-...@googlegroups.com.

Amnon Harel

unread,
Nov 11, 2016, 6:07:47 AM11/11/16
to Benjamin Kehlet, fenics-support
Hi Benjamin,

I really didn't want to use docker. I have somewhat limited disk space on my trusty 5-years old lapton, and 95% of the stuff needed is already installed. But I guess that if mshr can't be installed from source, I'll just have to bite the bullet.

Anyway, to install FEniCS from source, I basically did (ignoring steps where I installed other packages using the package manager, a few mistakes I undid, etc.):
mkdir git2
cd git2
git init .
cd fiat\
git checkout fiat-2016.1.0
pip install .
cd ..
git clone https://bitbucket.org/fenics-project/ufl.git
cd ufl/
git checkout ufl-2016.1.0
pip install .
cd ..
git clone https://bitbucket.org/fenics-project/dijitso
cd dijitso/
git checkout dijitso-2016.1.0
pip install .
cd ..
git clone https://bitbucket.org/fenics-project/instant
cd instant/
git checkout instant-2016.1.0
pip install .
cd ..
git clone https://bitbucket.org/fenics-project/ffc 
cd ffc 
git checkout ffc-2016.1.0 
pip install . 
cd ..
git clone https://bitbucket.org/fenics-project/dolfin
cd dolfin/
git checkout dolfin-2016.1.0
mkdir build
cd build
cmake ..
cd ../..
cd mshr
git checkout mshr-2016.1.0
mkdir build; cd build
source /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin.conf
cmake ..

and got the errors I reported above.

 many thanks,
 Amnon

>> > To unsubscribe from this group and stop receiving emails from it, send an email to fenics-support+unsubscribe@googlegroups.com.
>> > To post to this group, send email to fenics-support@googlegroups.com.

Johannes Ring

unread,
Nov 11, 2016, 6:12:14 AM11/11/16
to Amnon Harel, Benjamin Kehlet, fenics-support
You are missing some steps here. Try

cmake .. -DCMAKE_INSTALL_PREFIX=/some/dir
make
make install
source /some/dir/share/dolfin/dolfin.conf

> cd ../..
> git clone https://bitbucket.org/fenics-project/mshr
> cd mshr
> git checkout mshr-2016.1.0
> mkdir build; cd build
> source /home/aharel/lingacom/FEniCS/git2/dolfin/build/dolfin.conf
> cmake ..

Same here:

cmake .. -DCMAKE_INSTALL_PREFIX=/some/dir
make
make install

Johannes
>> >> > send an email to fenics-suppor...@googlegroups.com.
>> >> > To post to this group, send email to fenics-...@googlegroups.com.
>> >> > To view this discussion on the web visit
>> >> > https://groups.google.com/d/msgid/fenics-support/8f2ed992-1cb8-4331-b040-9e61075cd37f%40googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "fenics-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fenics-suppor...@googlegroups.com.
> To post to this group, send email to fenics-...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fenics-support/CABPGvizi_6Wc8XZgm224Ns9etQSozGeerXCe0j0E_d0euSri3A%40mail.gmail.com.

Benjamin Kehlet

unread,
Nov 11, 2016, 6:18:57 AM11/11/16
to Amnon Harel, fenics-support

This should look something like
cmake [-DCMAKE_INSTALL_PREFIX=installation/path] ..
make
make install

Then you will find dolfin.conf in dolfin-installation-path/share/dolfin which you can source and continue with mshr.

Best regards

Benjamin

>> >> > To unsubscribe from this group and stop receiving emails from it, send an email to fenics-suppor...@googlegroups.com.
>> >> > To post to this group, send email to fenics-...@googlegroups.com.

Amnon Harel

unread,
Nov 11, 2016, 8:28:48 AM11/11/16
to Johannes Ring, Benjamin Kehlet, fenics-support
Oops. That was a silly mistake. Sorry.
Thanks again for your help!

 Amnon

>> >> > send an email to fenics-support+unsubscribe@googlegroups.com.
>> >> > To post to this group, send email to fenics-support@googlegroups.com.

>> >> > To view this discussion on the web visit
>> >> > https://groups.google.com/d/msgid/fenics-support/8f2ed992-1cb8-4331-b040-9e61075cd37f%40googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "fenics-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fenics-support+unsubscribe@googlegroups.com.
> To post to this group, send email to fenics-support@googlegroups.com.

> To view this discussion on the web visit

Amnon Harel

unread,
Nov 13, 2016, 6:21:46 AM11/13/16
to Johannes Ring, Benjamin Kehlet, fenics-support
Dear all,

Below is the installation from source procedure for dolfin and mshr that worked for me. I hope it may be useful to others, as there are lots of details to get right, and googling found some misleading information.
Perhaps something like this can be linked from https://fenicsproject.org/download/  ?

 cheers,
 Amnon

# prerequisites for mshr: gmplib and mpfr. I also installed vtk.
export BASE_DIR=/home/aharel/lingacom/FEniCS/git2
export TAG=2016.1.0   # this sequence will probably not work "as is" for any other tag

mkdir BASE_DIR
cd BASE_DIR
git checkout fiat-$TAG
pip install .
cd ..

cd ufl/
git checkout ufl-$TAG
pip install .
cd ..

cd dijitso/
git checkout dijitso-$TAG
pip install .
cd ..

cd instant/
git checkout instant-$TAG
pip install .
cd ..

cd ffc
git checkout ffc-$TAG
pip install .
cd ..

cd dolfin/
git checkout dolfin-$TAG
mkdir build; cd build
cmake ..
make
make install
cd ..
./cmake/scripts/generate-swig-interface
./cmake/scripts/generate-swig-docstrings
cd ..

git checkout mshr-$TAG
mkdir build; cd build
source $BASE_DIR/dolfin/build/dolfin.conf
cmake ..
make
make install

# I also needed to setup LD_LIBRARY_PATH and PYTHONPATH, so that "import dolfin, mshr" will work in python



>> >> > To post to this group, send email to fenics-...@googlegroups.com.

>> >> > To view this discussion on the web visit
>> >> > https://groups.google.com/d/msgid/fenics-support/8f2ed992-1cb8-4331-b040-9e61075cd37f%40googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "fenics-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fenics-support+unsubscribe@googlegroups.com.
> To post to this group, send email to fenics-...@googlegroups.com.

> To view this discussion on the web visit
Reply all
Reply to author
Forward
0 new messages