mshr installation

819 views
Skip to first unread message

Lori Ray

unread,
Apr 10, 2017, 8:32:09 PM4/10/17
to fenics-support
Dear Group,

I am trying to install mshr on my Mac desktop, which is running on OSX 10.10.5. In installing mshr from source, I am experiencing some warnings in the first two installation steps and am uncertain whether they need to be addressed before I proceed.  If they do need to be resolved, I am asking for some direction on how to resolve them.  I am also confused about whether mshr is automatically installed as part of fenics, or needs to be installed separately (as I have tried to do).   

Thank you,

Lori


By way of background, I installed the newest stable version of fenics (2016.2) using the anaconda install.
Following the install, I attempted to execute a program which had run successfully on a Docker install of the previous fenics version.  Some objects were not recognized.
I then installed homebrew, and using homebrew, installed cgal.  My program ran well.  However, demo_csg_2D.py did not run.  "has_cgal()" was not recognized and when I commented out the lines associated with "has_cgal()", "Rectangle" was not recognized.
So I set about installing mshr.  I installed cmake via homebrew.  I then used cmake to install mshr from source.  

After entering the first command for the mshr installation (which included the command line argument for dependencies) (see below **) there was a warning that VTKConfig.cmake and/or vtk-config.cmake could not be found.  I cannot find either of these files anywhere on my computer.

Since it was only a warning, I continued with the "make" command.  Many, many lines of installing and building ran across my terminal (perhaps success!?) with the last few reporting the following errors:

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

make[2]: *** [libmshr.2017.1.0.dev0.dylib] Error 1

make[1]: *** [CMakeFiles/mshr.dir/all] Error 2

make: *** [all] Error 2



** Outcome from first step of mshr installation from source:

(fenicsproject) Macintosh:~ Administrator$ cmake -DDOLFIN_DIR=/Users/Administrator/anaconda/envs/fenicsproject/share/dolfin/cmake /Users/Administrator/Downloads/fenics-project-mshr-26c9724eebde

-- The C compiler identification is AppleClang 7.0.2.7000181

-- The CXX compiler identification is AppleClang 7.0.2.7000181

-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc

-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++

-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Boost version: 1.63.0

-- Found the following Boost libraries:

--   system

--   filesystem

--   program_options

-- Targetting Unix Makefiles

-- Using /Library/Developer/CommandLineTools/usr/bin/c++ compiler.

-- DARWIN_VERSION=14

-- Mac Leopard detected

-- Building CGAL

-- Current source dir: /Users/Administrator/Downloads/fenics-project-mshr-26c9724eebde/3rdparty

-- Binary dir: /Users/Administrator

-- CGAL build type: Debug

CMake Warning at CMakeLists.txt:86 (find_package):

  By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has

  asked CMake to find a package configuration file provided by "VTK", but

  CMake did not find one.

 

  Could not find a package configuration file provided by "VTK" with any of

  the following names:

 

    VTKConfig.cmake

    vtk-config.cmake

 

  Add the installation prefix of "VTK" to CMAKE_PREFIX_PATH or set "VTK_DIR"

  to a directory containing one of the above files.  If "VTK" provides a

  separate development package or SDK, be sure it has been installed.

 

 

-- VTK not found

-- Found SWIG: /Users/Administrator/anaconda/envs/fenicsproject/bin/swig (found version "3.0.11") 

-- Testing disabled

-- Configuring done

CMake Warning (dev):

  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake

  --help-policy CMP0042" for policy details.  Use the cmake_policy command to

  set the policy and suppress this warning.

 

  MACOSX_RPATH is not specified for the following targets:

 

   mshr

 

This warning is for project developers.  Use -Wno-dev to suppress it.

 

-- Generating done

-- Build files have been written to: /Users/Administrator

Jan Blechta

unread,
Apr 11, 2017, 4:28:08 AM4/11/17
to Lori Ray, fenics-support
On Mon, 10 Apr 2017 17:32:09 -0700 (PDT)
Lori Ray <lar...@gmail.com> wrote:

> Dear Group,
>
> I am trying to install mshr on my Mac desktop, which is running on
> OSX 10.10.5. In installing mshr from source, I am experiencing some
> warnings in the first two installation steps and am uncertain whether
> they need to be addressed before I proceed. If they do need to be
> resolved, I am asking for some direction on how to resolve them. I
> am also confused about whether mshr is automatically installed as
> part of fenics, or needs to be installed separately (as I have tried
> to do).
>
> Thank you,
>
> Lori
>
> By way of background, I installed the newest stable version of fenics
> (2016.2) using the anaconda install.
> Following the install, I attempted to execute a program which had run
> successfully on a Docker install of the previous fenics version.

mshr is indeed included in FEniCS Docker images. Still the Docker
images represent the easiest access to full-fledged FEniCS build with
all the useful dependencies.

> Some objects were not recognized.
> I then installed homebrew, and using homebrew, installed cgal. My
> program ran well. However, demo_csg_2D.py did not run. "has_cgal()"
> was not recognized and when I commented out the lines associated with
> "has_cgal()", "Rectangle" was not recognized.

This is probably an outdated demo with functionality which was
originally in DOLFIN and has been moved to mshr. I don't recommend
testing your installation using old random scripts.

> So I set about installing mshr. I installed cmake via homebrew. I
> then used cmake to install mshr from source.
>
> After entering the first command for the mshr installation (which
> included the command line argument for dependencies) (see below **)
> there was a warning that VTKConfig.cmake and/or vtk-config.cmake
> could not be found. I cannot find either of these files anywhere on
> my computer.

mshr can be configured without VTK. To suppress the warnings one can
pass -DMSHR_ENABLE_VTK=off to CMake.

>
> Since it was only a warning, I continued with the "make" command.
> Many, many lines of installing and building ran across my terminal
> (perhaps success!?) with the last few reporting the following errors:
>
> ld: symbol(s) not found for architecture x86_64

What precedes this message?

Jan

Johannes Ring

unread,
Apr 11, 2017, 4:34:06 AM4/11/17
to Lori Ray, fenics-support
On Tue, Apr 11, 2017 at 2:32 AM, Lori Ray <lar...@gmail.com> wrote:
> I am trying to install mshr on my Mac desktop, which is running on OSX
> 10.10.5. In installing mshr from source, I am experiencing some warnings in
> the first two installation steps and am uncertain whether they need to be
> addressed before I proceed. If they do need to be resolved, I am asking for
> some direction on how to resolve them.

No, they are not important.

> I am also confused about whether
> mshr is automatically installed as part of fenics, or needs to be installed
> separately (as I have tried to do).

It depends. The Docker images includes mshr, while it is not included
when installing the fenics package with conda. You can however install
it by running

conda install -c conda-forge mshr

> By way of background, I installed the newest stable version of fenics
> (2016.2) using the anaconda install.
> Following the install, I attempted to execute a program which had run
> successfully on a Docker install of the previous fenics version.

Any particular reason for not using the Docker install?

> Some
> objects were not recognized.

Was this perhaps because you hadn't installed mshr with conda?

> I then installed homebrew, and using homebrew, installed cgal.

CGAL is already included with mshr, so no need to install it
separately. Also mixing conda and homebrew might lead to problems, so
try to stick to one of them.

> My program
> ran well. However, demo_csg_2D.py did not run. "has_cgal()" was not
> recognized and when I commented out the lines associated with "has_cgal()",
> "Rectangle" was not recognized.

demo_csg_2D.py is not included in recent versions of mshr, however I
found it in an older version (1.4) of DOLFIN. This demo will not work
(without modification) with recent versions of FEniCS.

> So I set about installing mshr. I installed cmake via homebrew. I then
> used cmake to install mshr from source.

I would recommend using either the Docker images or the conda
installation of fenics and mshr. If you have problems with any of
these, then please let us know.

Johannes
> --
> 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/0e8b3c4d-9612-4b14-b639-0c0accc50e99%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Lori Ray

unread,
Apr 11, 2017, 11:39:21 AM4/11/17
to fenics-support
Thank you for your responses.  
mshr is (and probably has been) working just fine in my docker installation of fenics.  The confusion was in using the proper syntax to communicate with it.  I see now that the demo I was looking to was for Dolfin 1.3.  After making modifications to the code based on Anders 6/2/2016 article on "Mesh Generation in fenics," I have a simple code that uses mshr working fine.  
Can you please direct me to a demo or documentation that teaches to using mshr for generating more complex meshes in fenics (creating complex geometries through addition and subtraction of shapes and creating subdomains with different meshing to improve mesh quality).  
Best Regards,
Lori   

Jan Blechta

unread,
Apr 11, 2017, 12:00:57 PM4/11/17
to Lori Ray, fenics-support
On Tue, 11 Apr 2017 08:39:21 -0700 (PDT)
Lori Ray <lar...@gmail.com> wrote:

> Thank you for your responses.
> mshr is (and probably has been) working just fine in my docker
> installation of fenics. The confusion was in using the proper syntax
> to communicate with it. I see now that the demo I was looking to was
> for Dolfin 1.3. After making modifications to the code based on
> Anders 6/2/2016 article on "Mesh Generation in fenics," I have a
> simple code that uses mshr working fine.
> Can you please direct me to a demo or documentation that teaches to
> using mshr for generating more complex meshes in fenics (creating
> complex geometries through addition and subtraction of shapes and
> creating subdomains with different meshing to improve mesh quality).

mshr documentation is so far at
https://bitbucket.org/fenics-project/mshr/wiki/Home. It needs porting
to the official FEniCS reference at
http://fenics.readthedocs.io/en/latest/. Demos are at
https://bitbucket.org/fenics-project/mshr/src/master/demo/python/
and need documenting and moving to RTD too. Contributions are welcome.

Jan
Reply all
Reply to author
Forward
0 new messages