dealii in homebrew (osx)

883 views
Skip to first unread message

Denis Davydov

unread,
Oct 20, 2014, 10:17:43 AM10/20/14
to dea...@googlegroups.com
Dear all, 

as I updated to OS-X Yosemite this weekend, 
I was motivated to try some other solution for 
package management. 
I was using MacPorts to compile GCC before. 
This time I tried Homebrew http://brew.sh
I found it quite nice that all "recipes" (Formulas) to 
build are easy to read (ruby) and one can modify 
them to suit one's needs. 

I updated a couple of existing Formulas as well 
as added some more to compile the whole deal.II suite.
They are all on the GitHub fork of homebrew-science

Installing the complete deal.II suite from scratch is something like:

brew install gcc --without-multilib
brew install openmpi --c++11
git clone https://github.com/davydden/homebrew-science.git $(brew --repository)/Library/Taps/davydden/homebrew-science
brew update  # that will create symlinks to formulas by Tapping custom repo
brew install scalapack
brew install mumps
brew install metis
brew install parmetis
#brew install hypre
brew install superlu_dist
brew install petsc --with-superlu_dist --with-metis --with-parmetis --with-scalapack --with-mumps --complex
brew install arpack --with-mpi
brew install slepc --with-arpack
brew install netcdf
brew install trilinos --with-boost --with-netcdf --without-tests --remove-warnings --with-release --with-fortran
brew install hdf5 --enable-parallel 
brew install p4est
brew install gsl
           brew install dealii 

note that I did not try "hypre" as I used complex-valued petsc.
I also tested dealii "Formula" with --devel flag, which is linked to my local 
dealii's fork. You can modify it to your liking.
Apart from that, it worked for me on 
OS X Yosemite 10.10 and Xcode 6.1 (important!). 
Deal.ii found all the libs but NETCDF. 

Regards,
Denis.

Denis Davydov

unread,
Oct 22, 2014, 4:24:12 AM10/22/14
to dea...@googlegroups.com
I noticed that if symlinks for deal.II library are created in 
/usr/local/lib  and /usr/local/opt/dealii, 
then CMake find the library in "/usr/local", but does not find the 
cmake scripts, which are in /usr/local/opt/dealii/cmake/macros/.. 
If one forces /usr/local/opt/dealii location, then it is fine. 

Any idea what is a good location to symlink those macros to make Cmake happy
and pick them up with the deal.ii dir in /usr/local?

Regards,
Denis.

Denis Davydov

unread,
Oct 22, 2014, 4:34:42 AM10/22/14
to dea...@googlegroups.com
p.s. I do see other dealii's Cmake scripts like
   deal.IIConfig.cmake 
   deal.IIConfigVersion.cmake,
   ...
linked in 
   /usr/local/lib/cmake/deal.II 
but the macros are not there. 
Should the macros, perhaps, be rather in the
target-dir-to-dealii/lib/cmake/deal.II directory upon installation?

Regards,
Denis.
Message has been deleted

Ashkan Dorostkar

unread,
Oct 22, 2014, 5:16:19 AM10/22/14
to dea...@googlegroups.com
Hi, 
thank you. Just a question. 
One doesn't need to specify that one wants deal.ii with mpi? On the rest of the brew you are mentioning parallel

Denis Davydov

unread,
Oct 22, 2014, 5:25:47 AM10/22/14
to dea...@googlegroups.com


On Wednesday, October 22, 2014 11:16:19 AM UTC+2, Ashkan Dorostkar wrote:
Hi, 
thank you. Just a question. 
One doesn't need to specify that one wants deal.ii with mpi? On the rest of the brew you are mentioning parallel

mpi is a "recommended" dependency, that is, if it installed, 
the deal.ii will install with MPI compilers without the need to do "brew install dealii --with-mpi". 
However, you can turn it off by "brew install dealii --without-mpi". 
You can examine/edit the "Formula" by "brew edit dealii", it's quite straight forward to read what happens.

If you don't need to control what to install, you could try Luca's precompiled package with everything: 
I do not use it as I need both complex and real valued versions of PETSc/SLEPc. 

Regards,
Denis.

Ashkan Dorostkar

unread,
Oct 22, 2014, 9:25:57 AM10/22/14
to dea...@googlegroups.com
Just an update,
Trying to use the brew you have made for deal.ii 8.1 produces an error which says there is no CMakeFile.
I'll try to modify what you made.

Denis Davydov

unread,
Oct 22, 2014, 9:45:00 AM10/22/14
to dea...@googlegroups.com
can you post the relevant output in verbose mode? 
The installation worked fine for me although with --devel key, 
but there should be no difference unless the url on top is wrong.

Denis Davydov

unread,
Oct 22, 2014, 9:55:09 AM10/22/14
to dea...@googlegroups.com
I uninstalled my current dealii, 
cleaned the Cache and run 
brew install dealii --head  
and there is no problem with CMake...

Matthias Maier

unread,
Oct 22, 2014, 9:59:49 AM10/22/14
to dea...@googlegroups.com

Am 22. Okt 2014, 10:34 schrieb Denis Davydov <davy...@gmail.com>:

> p.s. I do see other dealii's Cmake scripts like
> deal.IIConfig.cmake
> deal.IIConfigVersion.cmake,
> ...
> linked in
> /usr/local/lib/cmake/deal.II
> but the macros are not there.
> Should the macros, perhaps, be rather in the
> target-dir-to-dealii/lib/cmake/deal.II directory upon installation?
>
> Regards,
> Denis.
>

The important location is that of deal.IIConfig.cmake. It determines
DEAL_II_PATH from its location and the value of
DEAL_II_PROJECT_CONFIG_RELDIR.

Afterwards, the macros are assumed to be located at

${DEAL_II_PATH}/${DEAL_II_CMAKE_MACROS_RELDIR}.

The RELDIR variables can be overridden at configure time to suit almost
any installation layout.

Have a lookt at ./doc/users/cmake.html and ./doc/users/config.sample

Best,
Matthias

Denis Davydov

unread,
Oct 22, 2014, 10:05:28 AM10/22/14
to dea...@googlegroups.com
On Wednesday, October 22, 2014 3:25:57 PM UTC+2, Ashkan Dorostkar wrote:
Just an update,
Trying to use the brew you have made for deal.ii 8.1 produces an error which says there is no CMakeFile.
I'll try to modify what you made.


I fixed the dealii formula, please update to the new one.  
The directory structure is different for the head and release branches, 
thus the error. 

Denis Davydov

unread,
Oct 22, 2014, 11:23:35 AM10/22/14
to dea...@googlegroups.com
On Wednesday, October 22, 2014 3:59:49 PM UTC+2, Matthias Maier wrote:
The important location is that of deal.IIConfig.cmake. It determines
DEAL_II_PATH from its location and the value of
DEAL_II_PROJECT_CONFIG_RELDIR.

Afterwards, the macros are assumed to be located at

  ${DEAL_II_PATH}/${DEAL_II_CMAKE_MACROS_RELDIR}.

The RELDIR variables can be overridden at configure time to suit almost
any installation layout.

Have a lookt at ./doc/users/cmake.html and ./doc/users/config.sample


Thanks for your reply, Matthias.
I think I face a bit different problem.
The point is, that the installation directory of the deal.II is one thing (e.g. /usr/local/Cellar/dealii/8.2-devel)
but after it is installed, Homebrew creates symlinks  
/usr/local/lib/libdeal_II.8.2.pre.dylib  
/usr/local/lib/cmake/deal.II  (that's where deal.IIConfig.cmake is located)
/usr/local/include/deal.II

so the deal.II path is found to be  "DEAL_II_PATH=/usr/local". 
And of course, the combination of that with DEAL_II_CMAKE_MACROS_RELDIR "cmake/macros"
does play good, as the proper location of macros are /usr/local/Cellar/dealii/8.2-devel/cmake/macros. 
So, in a sense, I would like to keep macros installed where they are by default ("PREFIX/cmake/macros") 
but only help CMake to find them when configuring my own project with deal.II. 


Regards,
Denis.


Denis Davydov

unread,
Oct 22, 2014, 11:49:38 AM10/22/14
to dea...@googlegroups.com


On Wednesday, October 22, 2014 5:23:35 PM UTC+2, Denis Davydov wrote:
Thanks for your reply, Matthias.
I think I face a bit different problem.
The point is, that the installation directory of the deal.II is one thing (e.g. /usr/local/Cellar/dealii/8.2-devel)
but after it is installed, Homebrew creates symlinks  
/usr/local/lib/libdeal_II.8.2.pre.dylib  
/usr/local/lib/cmake/deal.II  (that's where deal.IIConfig.cmake is located)
/usr/local/include/deal.II

so the deal.II path is found to be  "DEAL_II_PATH=/usr/local". 
And of course, the combination of that with DEAL_II_CMAKE_MACROS_RELDIR "cmake/macros"
does play good, as the proper location of macros are /usr/local/Cellar/dealii/8.2-devel/cmake/macros. 
So, in a sense, I would like to keep macros installed where they are by default ("PREFIX/cmake/macros") 
but only help CMake to find them when configuring my own project with deal.II. 

I solved the issue. 
DEAL_II_COMPONENT_COMPAT_FILES=OFF did the trick, 
as Homebrew create symlinks for shared folder and thus it all works. 
Will update the formula now...
Thanks, Matthias for pointing to the right direction.

Regards,
Denis. 

Ashkan Dorostkar

unread,
Oct 23, 2014, 4:50:04 AM10/23/14
to dea...@googlegroups.com
Thank you, it works now.
Could you please add an option to use the bundled boost for installation?

Denis Davydov

unread,
Oct 23, 2014, 4:56:38 AM10/23/14
to dea...@googlegroups.com

> 23 окт. 2014 г., в 10:50, Ashkan Dorostkar <ashkan.d...@gmail.com> написал(а):
>
> Thank you, it works now.
Good. Nice to hear.

> Could you please add an option to use the bundled boost for installation?
I will have a look at it on Sunday,
Currently i'm away from the computer.

Regards,
Denis

Denis Davydov

unread,
Oct 23, 2014, 7:18:33 AM10/23/14
to dea...@googlegroups.com
Bwt, you can try to uninstall boost (homebrew uninstall boost) and trilinos, then reinstall trilinos without "--with-boost" and reinstall deal.II.
I would expect that it will then fallback to the bundled boost.

Regards,
Denis

23 окт. 2014 г., в 10:50, Ashkan Dorostkar <ashkan.d...@gmail.com> написал(а):

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/tl7uZ1Exw5o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthias Maier

unread,
Oct 23, 2014, 7:22:00 AM10/23/14
to dea...@googlegroups.com

Am 23. Okt 2014, 13:18 schrieb Denis Davydov <davy...@gmail.com>:

> I would expect that it will then fallback to the bundled boost.

You might want to consider setting DEAL_II_ALLOW_AUTODETECTION to FALSE
for any source or binary packaging you do - autodetection is almost
always a feature you do not want to have in this situation.

Best,
Matthias

Denis Davydov

unread,
Oct 23, 2014, 7:44:42 AM10/23/14
to dea...@googlegroups.com

> You might want to consider setting DEAL_II_ALLOW_AUTODETECTION to FALSE
> for any source or binary packaging you do - autodetection is almost
> always a feature you do not want to have in this situation.
>
> Best,
> Matthias

I see why is it important for self-compiling when one points to trilinos/petsc/ect manually.
That's how i usually install deal.II myself.

But in the case of the package manager (macports/homebrew/fink),
this would imply that the user needs to specify all the paths (petsc/slepc/trilinos/boost/ect) himself, which, IMHO, defeats the idea of the package manager.

Kind regards,
Denis

Ashkan Dorostkar

unread,
Oct 23, 2014, 7:51:45 AM10/23/14
to dea...@googlegroups.com
Not necessarily,
If the user says for example --with-trilinos, then home-brew installs trillions first and then you can point to it in the formula since you know it is installed in the cellar.

Denis Davydov

unread,
Oct 23, 2014, 8:10:59 AM10/23/14
to dea...@googlegroups.com

> 23 окт. 2014 г., в 13:51, Ashkan Dorostkar <ashkan.d...@gmail.com> написал(а):
>
> Not necessarily,
> If the user says for example --with-trilinos, then home-brew installs trillions first and then you can point to it in the formula since you know it is installed in the cellar.

I see what u mean.
But Homebrew does symlink everything from Cellar to /usr/local/lib.
So effectively there is no need to use the specific location in Cellar.
One could of course specify "/usr/local" as location for each Homebrew's library (petsc/slepc/trilinos/etc) to make sure it is linked against Homebrew's versions and not, say, Macports version. I will try adding that...

Regards,
Denis

Matthias Maier

unread,
Oct 23, 2014, 8:16:25 AM10/23/14
to dea...@googlegroups.com
CMAKE_PREFIX_PATH="/usr/local"

ensures a genereic preference of "/usr/local" over everything else.

Denis Davydov

unread,
Oct 23, 2014, 8:25:44 AM10/23/14
to dea...@googlegroups.com

> CMAKE_PREFIX_PATH="/usr/local"
>
> ensures a genereic preference of "/usr/local" over everything else.

Thanks, will give it a go

Ashkan Dorostkar

unread,
Oct 26, 2014, 9:58:09 AM10/26/14
to dea...@googlegroups.com
Hi,
I attached what I used to install deal.ii based on your formula. Feel free to update your repository if you like this.
dealii.rb

Denis Davydov

unread,
Oct 27, 2014, 5:14:16 AM10/27/14
to dea...@googlegroups.com
Thanks, Ashkan.  
I will slightly adjust your version, as I don't think it's good to enforce "complex" option as default for PETSc. 
And also "GSL" is not needed for deal.II, it's just something I use. 

Regards,
Denis.

Denis Davydov

unread,
Oct 27, 2014, 6:16:15 AM10/27/14
to dea...@googlegroups.com
I had to re-fork the GitHub repo. 
Please use this command (instead of the one above) 
to clone the dedicated branch:

git clone https://github.com/davydden/homebrew-science.git --branch dealii_suite $(brew –repository)/Library/Taps/davydden/homebrew-science

Regards,
Denis.

Denis Davydov

unread,
Jan 10, 2015, 5:13:51 AM1/10/15
to dea...@googlegroups.com
An updated list of commands for 8.2.0  with literally everything but 64bit indices:

brew install gcc --without-multilib
brew install openmpi --c++11
git clone https://github.com/davydden/homebrew-science.git $(brew --repository)/Library/Taps/davydden/homebrew-science
# the following will create symlinks to formulas by Tapping custom repo
brew update
brew install scalapack --with-shared-libs
brew install mumps
brew install metis
brew install parmetis
brew install hypre --with-mpi
brew install superlu
brew install superlu_dist
brew install petsc
brew install arpack --with-mpi
brew install slepc
brew install hdf5 --with-mpi 
brew install netcdf --with-cxx-compat --with-fortran
brew install trilinos --without-python --release --with-netcdf --with-metis --with-mumps --with-parmetis --with-scalapack --with-superlu --with-hdf5 --with-hypre --with-scotch --with-adol-c --with-glpk
brew install p4est
brew install gsl
brew install ./numdiff.rb
brew install dealii --with-petsc --with-slepc --with-trilinos

p.s. there are two warnings Homebrew generates which can be neglected:

1) Warning: No Fortran optimization information was provided.

2) dependency gcc was built with a different C++ standard library (libstdc++ from clang). This may cause problems at runtime.

Denis Davydov

unread,
Jan 10, 2015, 1:27:01 PM1/10/15
to dea...@googlegroups.com
As Luca said in another thread, Cmake 3.1.0 is broke. Before going through that whole installation one has to be sure 3.0.2 (works for me) is installed. 
To that end, from the Homebrew folder (usr/local) do:

# checkout state with cmake 3.0.2:
git checkout b950d649855977b89812ec5c3794501f073a7e09
brew install cmake
# stop from updating
brew pin cmake  
# go back to HEAD:
git checkout master

chad....@hoveyconsulting.com

unread,
Jan 13, 2015, 12:29:43 AM1/13/15
to dea...@googlegroups.com
I began the day with watching the first three Wolfgang Bangerth lectures from MATH 676, getting stuck in Lecture 3, "Obtaining and installing deal.II".    With deal.II version 8.2, the build on my Mac OS X Yosemite (version 10.10.1), with XCode (version 6.6.1) went along fine, e.g., 

Zeus:build Zeus$ pwd

/Users/Zeus/Google/code/dealii/dealii-8.2.0/build

Zeus:build Zeus$ cmake -DCMAKE_INSTALL_PREFIX=/Users/Zeus/bin/dealii-8.2.0/ ..

-- This is CMake 2.8.12.2

--

-- Setting up cached variables.

-- The CXX compiler identification is GNU 4.8.2

-- The C compiler identification is GNU 4.8.2

-- Checking whether CXX compiler has -isysroot

-- Checking whether CXX compiler has -isysroot - yes

-- Checking whether CXX compiler supports OSX deployment target flag

-- Checking whether CXX compiler supports OSX deployment target flag - yes

-- Check for working CXX compiler: /opt/local/bin/c++

-- Check for working CXX compiler: /opt/local/bin/c++ -- works


and then, using

Zeus:build Zeus$ cmake -DDEAL_II_INSTALL_PREFIX=/Users/Zeus/bin/dealii-8.2.0/ ..

-- This is CMake 2.8.12.2

--

-- Setting up cached variables.

--

-- Setting up default compiler flags.

--

-- Include /Users/Zeus/Google/code/dealii/dealii-8.2.0/bundled/setup_bundled.cmake

--

-- Include /Users/Zeus/Google/code/dealii/dealii-8.2.0/cmake/checks/check_01_compiler_features.cmake

--

-- Include /Users/Zeus/Google/code/dealii/dealii-8.2.0/cmake/checks/check_01_cpu_features.cmake

--

...which later reported

-- Configuring done

-- Generating done

CMake Warning:

 Manually-specified variables were not used by the project:

   DEAL_II_INSTALL_PREFIX

-- Build files have been written to: /Users/Zeus/Google/code/dealii/dealii-8.2.0/build

Zeus:build Zeus$




Next, the make went fine until 58% through 

In file included from /Users/Zeus/Google/code/dealii/dealii-8.2.0/include/deal.II/grid/tria.h:24:0,

                from /Users/Zeus/Google/code/dealii/dealii-8.2.0/source/grid/grid_tools.cc:18:

/Users/Zeus/Google/code/dealii/dealii-8.2.0/include/deal.II/base/geometry_info.h: In instantiation of 'static void dealii::GeometryInfo<dim>::alternating_form_at_vertices(const dealii::Point<spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell], dealii::Tensor<(spacedim - dim), spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell]) [with int spacedim = 1; int dim = 1]':

/Users/Zeus/Google/code/dealii/dealii-8.2.0/source/grid/grid_tools.cc:1811:9:   required from here

/Users/Zeus/Google/code/dealii/dealii-8.2.0/include/deal.II/base/geometry_info.h:1860:3:

error: size of array is not an integral constant-expression

  alternating_form_at_vertices

  ^

/Users/Zeus/Google/code/dealii/dealii-8.2.0/include/deal.II/base/geometry_info.h:1860:3: error: size of array is not an integral constant-expression

/Users/Zeus/Google/code/dealii/dealii-8.2.0/include/deal.II/base/geometry_info.h: In instantiation of 'static void dealii::GeometryInfo<dim>::alternating_form_at_vertices(const dealii::Point<spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell], dealii::Tensor<(spacedim - dim), spacedim> (&)[dealii::GeometryInfo<dim>::vertices_per_cell]) [with int spacedim = 2; int dim = 2]':


This same error was noted in the thread started by Scott Miller, 2013-04-25.  At this point, I read the Mac installation thread started by Denis Davydov on 2014-10-20, on an install/build tailored for the Mac.  Now I have Homebrew (http://brew.sh) installed.

Following advice from 
Zeus:~ Zeus$ brew doctor

updated XQuartz from 2.7.5 to 2.7.7, and then followed warning

Warning: You have MacPorts or Fink installed:

 /opt/local/bin/port


This can cause trouble. You don't have to uninstall them, but you may want to

temporarily move them out of the way, e.g.


 sudo mv /opt/local ~/macports


via

Zeus:~ Zeus$ sudo mv /opt/local/ ~/macports

Password:


Zeus:~ Zeus$ brew doctor

Your system is ready to brew.


I also updated CMake from 2.8.12.2 to 3.1.0, but found Danis Davydov on 2015-01-10 (via Luca) that CMake 3.1.0 is broken, so I rolled back to CMake 3.0.2.  

Now when I build

Zeus:build Zeus$ cmake -DCMAKE_INSTALL_PREFIX=/Users/Zeus/bin/dealii-8.2.0/ ..

-- This is CMake 3.0.2

--

-- Setting up cached variables.

-- The CXX compiler identification is unknown

-- The C compiler identification is unknown

CMake Error at CMakeLists.txt:86 (PROJECT):

 The CMAKE_CXX_COMPILER:


   /opt/local/bin/c++


 is not a full path to an existing compiler tool.


 Tell CMake where to find the compiler by setting either the environment

 variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path

 to the compiler, or to the compiler name if it is in the PATH.



CMake Error at CMakeLists.txt:86 (PROJECT):

 The CMAKE_C_COMPILER:


   /opt/local/bin/gcc


 is not a full path to an existing compiler tool.


my CMAKE_CXX_COMPILER fails because of my previous sudo mv /opt/local ~/macports

I've done a fair bit of nonlinear FEA development, but I'm certainly not an expert with build systems.  

I've done enough programming to know I'm in the weeds, and need to ask for help.  

You have my sincere gratitude for any assistance you can share.

Thank you.

Denis Davydov

unread,
Jan 13, 2015, 12:49:30 AM1/13/15
to dea...@googlegroups.com
Hi, 

As long as you moved the whole macports folder elsewhere and it's outside of PATH variable in your bash profile, it should be fine, IMHO.
In your case, however, this might be left-overs from previous configuration. 
You could try deleting the cashes and all CMake files via (in the deal.II build folder):

rm CMakeCache.txt
rm -r CMakeFiles

and then trying again. 

p.s. If you need just 8.2.0, you could also try with those homebrew formulae above.

Regards,
Denis.

Luca Heltai

unread,
Jan 13, 2015, 3:25:11 AM1/13/15
to Deal.II Users
Maybe we didn't stress this enough in the mailing list, however...

Every new release of deal.II (since 8.0) comes with a prebuilt package for Mac OS X, which can be found under the releases page of github, or following our "download" button. The package is a self-contained application that will work provided you have XCode command line tools installed, and cmake. When launched, the application will simply open up a terminal with some environment variables set up.

If everything else fails, grab that one.

I'm building 8.2.1, which will also work with cmake 3.1.

Luca.

--
Luca Heltai <luca....@gmail.com>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone: +39 040 3787 449, Office: 622
--
There are no answers, only cross references
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.

Denis Davydov

unread,
Jan 13, 2015, 3:41:42 AM1/13/15
to dea...@googlegroups.com
FIY, the way to install Homebrew version works perfectly fine for me ;-)

Denis Davydov

unread,
Jan 13, 2015, 3:47:26 AM1/13/15
to dea...@googlegroups.com
Jean-Paul Pelteret also had it successfully installed yesterday on his mac (Mavericks) via Homebrew.

p.s. I am on Yosemite

Luca Heltai

unread,
Jan 13, 2015, 6:06:30 AM1/13/15
to Deal.II Users
Just FYI,

I updated the binary files for Mac on github. You can find 8.2.1 here:

https://github.com/dealii/dealii/releases/tag/v8.2.1

L.

--
Luca Heltai <luca....@gmail.com>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone: +39 040 3787 449, Office: 622
--
There are no answers, only cross references

> On 13 Jan 2015, at 9:47, Denis Davydov <davy...@gmail.com> wrote:
>
> Jean-Paul Pelteret also had it successfully installed yesterday on his mac (Mavericks) via Homebrew.
>
> p.s. I am on Yosemite
>

chad....@hoveyconsulting.com

unread,
Jan 13, 2015, 12:49:48 PM1/13/15
to dea...@googlegroups.com
Thank you to both Luca Heltai and Denis Davydov for their replies.

Luca, thank you for alerting me to the prebuilt binary release for Mac OS X.  I understand your answer to have two ramifications:
  1. If I want a prebuilt binary, which obviates the build step, use it.
  2. The prebuilt binary, on first invocation, sets up environment variables.
Since I am (eventually) interested in coding up some contact algorithms that I developed for my Ph.D., I definitely want to have the ability to compile locally, not just run a prebuilt binary.  However, I interpret your answer as, "running the prebuilt binary will set up some environment variables, which will iron out the environment variables problem that is currently stopping the build of the locally compiled debug version, and thus allow your local build to succeed."  

Thank you also for alerting me to the release of deal.II 8.2.1, which will work with CMake 3.1.0.  

Denis, I learned from your advice, and followed the following steps to confirm 100% build.   Thank you!

Zeus:build Zeus$ pwd

/Users/Zeus/Google/code/dealii/dealii-8.2.0/build

Zeus:build Zeus$ rm CMakeCache.txt

Zeus:build Zeus$ rm -r CMakeFiles/

Zeus:build Zeus$ cmake -DCMAKE_INSTALL_PREFIX=/Users/Zeus/bin/dealii-8.2.0/ ..

-- This is CMake 3.0.2

--

-- Setting up cached variables.

-- The CXX compiler identification is AppleClang 6.0.0.6000056

-- The C compiler identification is AppleClang 6.0.0.6000056

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

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

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working C compiler: /usr/bin/cc

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


et cetera...
Zeus:build Zeus$ cmake -DDEAL_II_INSTALL_PREFIX=/Users/Zeus/bin/dealii-8.2.0/ ..
Zeus:build Zeus$ make

Tomorrow, I will try running the example in Lecture 3 to verify runtime .eps file outputs.  

Many thanks!  

Chad

Denis Davydov

unread,
Jan 13, 2015, 1:37:49 PM1/13/15
to dea...@googlegroups.com
Hi Chad,

I am glad it compiles now!

On Tuesday, January 13, 2015 at 6:49:48 PM UTC+1, chad....@hoveyconsulting.com wrote:
Since I am (eventually) interested in coding up some contact algorithms that I developed for my Ph.D., I definitely want to have the ability to compile locally, not just run a prebuilt binary.  

that's what I also do as I have some modification to deal.II which are still sitting in pull-requests on GitHub. 

It is of course a personal preference how to install deal.II, but since the topic title is related to Homebrew, let me quickly share my workflow, 
which might be useful for others:

I install deal.II from local git repo to Homebrew's location via:

cmake -DCMAKE_BUILD_TYPE=DebugRelease -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/dealii/8.3pre-real -DDEAL_II_COMPONENT_COMPAT_FILES=OFF -DCMAKE_PREFIX_PATH=/usr/local -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_Fortran_COMPILER=mpif90 -DDEAL_II_WITH_PETSC=ON -DDEAL_II_WITH_SLEPC=ON -DDEAL_II_WITH_TRILINOS=ON ../

Additionally i have a release version installed using Homebrew's formula (brew install dealii --with-petsc --with-slepc --with-trilinos).

As a result I have two versions:
$ brew info dealii
dealii: stable 8.2.0, HEAD
/usr/local/Cellar/dealii/8.2.0 (520 files, 199M)
  Built from source with: --with-petsc, --with-slepc, --with-trilinos
/usr/local/Cellar/dealii/8.3pre-real (521 files, 344M) *
  Built from source

The one which is currently symlinked into /usr/local/[lib;include]  is marked with asterisk. 
That's the one which will be found automatically when you run Cmake in your projects.

If needed, one can easily switch between the two via 
   brew switch dealii 8.2.0
       or
   brew switch dealii 8.3pre-real
which will unlink current version and symlink the new choice.

Regards,
Denis.

chad....@hoveyconsulting.com

unread,
Jan 15, 2015, 12:03:06 AM1/15/15
to dea...@googlegroups.com
Denis, thanks for the reply.  I'm happy to report I successfully finished Lecture 3, and have the grid-1.eps and grid-2.eps created. 

I appreciate the Homebrew notes, the link to your Github repo, and the notes about switching between 8.2.0 and 8.3pre-real.

Thanks again for all the pointers! ;-)

Denis Davydov

unread,
May 7, 2015, 4:22:25 PM5/7/15
to dea...@googlegroups.com
A small update, the dealii and everything else is now in homebrew science now:

Build: cmake ✔
Recommended: arpack ✔, boost ✔, hdf5 ✔, metis ✔, mumps ✔, muparser ✔, netcdf ✔, opencascade ✔, petsc ✔, p4est ✔, slepc ✔
Optional: openblas ✔, trilinos ✔


as you see, by default everything is installed but trilinos as otherwise their "bot" times out to build the "bottle" (pre-build library).
So if you want trilinos, u need to add "--with-trilinos".
"--with-openblas" should propagate nicely to most of dependencies (petsc, slepc, trilinos, etc).

Regards,
Denis.

Denis Davydov

unread,
May 7, 2015, 4:23:51 PM5/7/15
to dea...@googlegroups.com
p.s. and the same set-up compiles for me using LinuxBrew on Ubuntu with "--with-openblas".

Li Fan

unread,
Jan 21, 2016, 1:20:57 AM1/21/16
to deal.II User Group
Hi Denis,

I installed deal.ii using homebrew on my mac(EL Capitan OSX 10.11.2) . I followed the instruction from 

and installed this way:

brew install cmake
brew install openmpi --c++11
brew install boost --c++11
brew install gsl
brew install scalapack
brew install mumps
brew install metis
brew install parmetis
brew install hypre --with-mpi
brew install superlu43
brew install superlu_dist
brew install arpack --with-mpi --without-check
brew install hdf5 --with-mpi --c++11
brew install netcdf --with-fortran --with-cxx-compat
brew install suite-sparse
brew install hwloc
brew install sundials --with-mpi
brew install fftw --with-mpi --with-fortran
brew install petsc
brew install slepc
brew install p4est
brew install adol-c
brew install cppunit
brew install doxygen --with-graphviz
brew install glpk
brew install glm
brew install trilinos
brew install dealii
But when I tried to compile the example I always got this error

clang: warning: cannot compress debug sections (zlib not installed)

warning: unknown warning option '-Wno-long-double'; did you mean '-Wno-long-long'?

      [-Wunknown-warning-option]

1 warning generated.

make[3]: *** No rule to make target `/usr/local/lib/libmpi_usempi_ignore_tkr.a', needed by `step-3'.  Stop.


I checked the file in my mac and I only found "libmpi_usempi_ignore_tkr.dylib" instead of "libmpi_usempi_ignore_tkr.a".


Do you have any idea about this issue?

thanks,

Li


On Monday, October 20, 2014 at 10:17:43 AM UTC-4, Denis Davydov wrote:
Dear all, 

as I updated to OS-X Yosemite this weekend, 
I was motivated to try some other solution for 
package management. 
I was using MacPorts to compile GCC before. 
This time I tried Homebrew http://brew.sh
I found it quite nice that all "recipes" (Formulas) to 
build are easy to read (ruby) and one can modify 
them to suit one's needs. 

I updated a couple of existing Formulas as well 
as added some more to compile the whole deal.II suite.
They are all on the GitHub fork of homebrew-science

Installing the complete deal.II suite from scratch is something like:

brew install gcc --without-multilib
brew install openmpi --c++11
git clone https://github.com/davydden/homebrew-science.git $(brew --repository)/Library/Taps/davydden/homebrew-science
brew update  # that will create symlinks to formulas by Tapping custom repo
brew install scalapack
brew install mumps
brew install metis
brew install parmetis
#brew install hypre
brew install superlu_dist
brew install petsc --with-superlu_dist --with-metis --with-parmetis --with-scalapack --with-mumps --complex
brew install arpack --with-mpi
brew install slepc --with-arpack
brew install netcdf
brew install trilinos --with-boost --with-netcdf --without-tests --remove-warnings --with-release --with-fortran
brew install hdf5 --enable-parallel 
brew install p4est
brew install gsl
           brew install dealii 

note that I did not try "hypre" as I used complex-valued petsc.
I also tested dealii "Formula" with --devel flag, which is linked to my local 
dealii's fork. You can modify it to your liking.
Apart from that, it worked for me on 
OS X Yosemite 10.10 and Xcode 6.1 (important!). 
Deal.ii found all the libs but NETCDF. 

Regards,
Denis.

Denis Davydov

unread,
Jan 21, 2016, 3:42:40 AM1/21/16
to deal.II User Group
Hi Li Fan,

Please post your configuration log. 
You can find it in Users/user_name/Library/Logs/Homebrew/dealii/01.cmake
The missing static lib is there for me.

Also did you have any issues while installing openmpi? Some errors, warnings?
It could be that you already have MPI self-installed some time ago and 
that confused everything.

Regards,
Denis.

Li Fan

unread,
Jan 21, 2016, 11:20:05 AM1/21/16
to deal.II User Group
Hi Denis,

Thanks. I checked the path you mentioned but unfortunately I could not find any dealii folder under the ~/Library/Logs/Homebrew.
I followed the instruction to install the deal.ii on a brand new mac yesterday. I remember I got a warning like the openmpi dependency of gcc was built with a different c++ library.

best,
Li

Denis Davydov

unread,
Jan 21, 2016, 12:07:22 PM1/21/16
to deal.II User Group

On Thursday, January 21, 2016 at 5:20:05 PM UTC+1, Li Fan wrote:
Hi Denis,

Thanks. I checked the path you mentioned but unfortunately I could not find any dealii folder under the ~/Library/Logs/Homebrew.

Do you have other logs there? hypre, openmpi, etc?
 
I followed the instruction to install the deal.ii on a brand new mac yesterday. I remember I got a warning like the openmpi dependency of gcc was built with a different c++ library.

that's ok.

I suppose you have XCode installed together with command line tools?

I suggest you open an issue here: https://github.com/Homebrew/homebrew-science/issues
and we continue discussion there.  

Denis

Li Fan

unread,
Jan 21, 2016, 12:16:45 PM1/21/16
to deal.II User Group
I have all the logs there except deal.  

thanks,
Li

Denis Davydov

unread,
Jan 21, 2016, 12:17:44 PM1/21/16
to dea...@googlegroups.com
Then you can just do 

brew reinstall dealii

and the logs should be there. Strange that there aren’t…


--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/tl7uZ1Exw5o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.

Li Fan

unread,
Jan 21, 2016, 12:30:44 PM1/21/16
to deal.II User Group
Hi Denis,

thanks. I just reinstalled dealii but the logs for dealii were still not there. It's really weird. 

best,
Li

Denis Davydov

unread,
Jan 21, 2016, 1:22:30 PM1/21/16
to dea...@googlegroups.com
Try 

brew update
brew doctor

to see if you have any issues with homebrew. 

Li Fan

unread,
Jan 21, 2016, 1:26:10 PM1/21/16
to deal.II User Group
Thanks. I tried these commands and i got "You system is ready to brew".

thanks,
Li

Denis Davydov

unread,
Jan 21, 2016, 1:52:27 PM1/21/16
to dea...@googlegroups.com
ok, let’s move the discussion of your peculiar case to github….

Li Fan

unread,
Jan 21, 2016, 2:15:35 PM1/21/16
to deal.II User Group
Thanks. I just put another copy of  "libmpi_usempi_ignore_tkr.dylib"  into the same location (and change the extension from .dylib to .a) since I think libmpi_usempi_ignore_tkr.dylib is just an alias of usr/local/Cellar/open-mpi/1.10.1_1/lib/libmpi_usempi_ignore_tkr.6.dylib.

Now I can compile and make run of the examples but I still have the warning :

clang: warning: cannot compress debug sections (zlib not installed)

warning: unknown warning option '-Wno-long-double'; did you mean '-Wno-long-long'?

      [-Wunknown-warning-option]

1 warning generated.



best,
Li

Denis Davydov

unread,
Jan 21, 2016, 2:29:32 PM1/21/16
to dea...@googlegroups.com
IMHO, something is wrong with your XCode as zlib should be there:

xcode-select —install
$ ls /usr/include/zlib.h
brew reinstall dealii

Regards,
Denis.

Denis Davydov

unread,
Jan 21, 2016, 2:32:02 PM1/21/16
to dea...@googlegroups.com
you can also try adding 

export HOMEBREW_BUILD_FROM_SOURCE=true

just to make sure you don’t download pre-build packages, but build them locally.

Li Fan

unread,
Jan 21, 2016, 2:40:24 PM1/21/16
to deal.II User Group
Thanks. For the clang zlib warning, I found this:


But I still don't know how to fix it.

Anyway, at least I can compile my program now.

thanks a lot,

Li

Denis Davydov

unread,
Jan 21, 2016, 5:12:51 PM1/21/16
to dea...@googlegroups.com
On 21 Jan 2016, at 20:40, Li Fan <fanl...@gmail.com> wrote:

Thanks. For the clang zlib warning, I found this:


But I still don't know how to fix it.

AFAIK zlib is a part of XCode on mac. So when you have XCode installed it should be there.
You might need to run: xcode-select —install
and as I wrote before, the following file should then exist:
 $ ls /usr/include/zlib.h

Regards,
Denis.

Reply all
Reply to author
Forward
0 new messages