binaries for mac don't work

Asked by Stig Larsson

I installed the fenics binaries for mac on a macbook with OS X 10.6. When I tried the poisson demo I got the following error.
I also checked which python I am using.

stig-larssons-macbook:poisson stig$ python demo6.py
Checking mesh ordering (finished).
python(3176,0xa0829500) malloc: *** error for object 0xa07efdb0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Traceback (most recent call last):
  File "demo6.py", line 33, in <module>
    u0 = Constant(0.0)
TypeError: Constant() takes exactly 2 arguments (1 given)

stig-larssons-macbook:poisson stig$ which python
/sw/bin/python

stig-larssons-macbook:poisson stig$ python
Python 2.5.2 (r252:60911, Feb 16 2009, 20:35:34)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Anders Logg
Solved:
Last query:
Last reply:
Revision history for this message
Anders Logg (logg) said :
#1

On Thu, Jan 27, 2011 at 07:59:22AM -0000, Stig Larsson wrote:
> New question #143028 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/143028
>
> I installed the fenics binaries for mac on a macbook with OS X 10.6. When I tried the poisson demo I got the following error.
> I also checked which python I am using.
>
> stig-larssons-macbook:poisson stig$ python demo6.py
> Checking mesh ordering (finished).
> python(3176,0xa0829500) malloc: *** error for object 0xa07efdb0: pointer being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
> Traceback (most recent call last):
> File "demo6.py", line 33, in <module>
> u0 = Constant(0.0)
> TypeError: Constant() takes exactly 2 arguments (1 given)
>
> stig-larssons-macbook:poisson stig$ which python
> /sw/bin/python
>
> stig-larssons-macbook:poisson stig$ python
> Python 2.5.2 (r252:60911, Feb 16 2009, 20:35:34)
> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>>

I'm no expert on the Mac binaries, but I believe you need to use
FEniCS from the special FEniCS icon that gets installed in your
applications folder. Then you will get another version of Python.

The error messages above seem to indicate that you are running a
Python from Fink (?) and that you have an old conflicting version of
DOLFIN installed (where Constant expects two arguments instead of
one).

--
Anders

Revision history for this message
Johannes Ring (johannr) said :
#2

What is in demo6.py?

I also see that you are using Python from Fink (/sw/bin/python). The Mac binary will only work with system Python. You will need to remove/comment out anything Fink related in your ~/.profile and ~/.bashrc. Did you run the demo from the terminal you get by clicking on the FEniCS icon or did you source the file /Applications/FEniCS.app/Contents/Resources/share/fenics/fenics.conf
?

Revision history for this message
Stig Larsson (stig-chalmers) said :
#3

Thanks Anders.

Yes, I have an old installation of fenics. How do I uninstall it?

Yes, I forgot that I should open the terminal using the fenics app.
In fact, it fails to open with a warning that I am using the wrong
python.

Johannes also pointed this out. But how do I change to the correct
python?

My ~/.profile is

test -r /sw/bin/init.sh && . /sw/bin/init.sh

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

source ~/Work/FEniCS/dolfin-0.9.0/dolfin.conf

I have no ~/.bashrc. It points to the old fenics. Regards. /stig

On 27 jan 2011 v 04, at 09.06, Anders Logg wrote:

> Your question #143028 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/143028
>
> Status: Open => Answered
>
> Anders Logg proposed the following answer:
> On Thu, Jan 27, 2011 at 07:59:22AM -0000, Stig Larsson wrote:
>> New question #143028 on DOLFIN:
>> https://answers.launchpad.net/dolfin/+question/143028
>>
>> I installed the fenics binaries for mac on a macbook with OS X
>> 10.6. When I tried the poisson demo I got the following error.
>> I also checked which python I am using.
>>
>> stig-larssons-macbook:poisson stig$ python demo6.py
>> Checking mesh ordering (finished).
>> python(3176,0xa0829500) malloc: *** error for object 0xa07efdb0:
>> pointer being freed was not allocated
>> *** set a breakpoint in malloc_error_break to debug
>> Traceback (most recent call last):
>> File "demo6.py", line 33, in <module>
>> u0 = Constant(0.0)
>> TypeError: Constant() takes exactly 2 arguments (1 given)
>>
>> stig-larssons-macbook:poisson stig$ which python
>> /sw/bin/python
>>
>> stig-larssons-macbook:poisson stig$ python
>> Python 2.5.2 (r252:60911, Feb 16 2009, 20:35:34)
>> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
>> Type "help", "copyright", "credits" or "license" for more
>> information.
>>>>>
>
> I'm no expert on the Mac binaries, but I believe you need to use
> FEniCS from the special FEniCS icon that gets installed in your
> applications folder. Then you will get another version of Python.
>
> The error messages above seem to indicate that you are running a
> Python from Fink (?) and that you have an old conflicting version of
> DOLFIN installed (where Constant expects two arguments instead of
> one).
>
> --
> Anders
>
> --
> If this answers your question, please go to the following page to
> let us
> know that it is solved:
> https://answers.launchpad.net/dolfin/+question/143028/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/dolfin/+question/143028
>
> You received this question notification because you are a direct
> subscriber of the question.

Revision history for this message
Johannes Ring (johannr) said :
#4

This is the line you need to comment out:

  test -r /sw/bin/init.sh && . /sw/bin/init.sh

Simply add a # in front of it:

  #test -r /sw/bin/init.sh && . /sw/bin/init.sh

You should also do the same for this line:

  source ~/Work/FEniCS/dolfin-0.9.0/dolfin.conf

Revision history for this message
Stig Larsson (stig-chalmers) said :
#5

It works! Thanks! /stig

On 27 jan 2011 v 04, at 09.28, Johannes Ring wrote:

> Your question #143028 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/143028
>
> Status: Open => Answered
>
> Johannes Ring proposed the following answer:
> This is the line you need to comment out:
>
> test -r /sw/bin/init.sh && . /sw/bin/init.sh
>
> Simply add a # in front of it:
>
> #test -r /sw/bin/init.sh && . /sw/bin/init.sh
>
> You should also do the same for this line:
>
> source ~/Work/FEniCS/dolfin-0.9.0/dolfin.conf
>
> --
> If this answers your question, please go to the following page to
> let us
> know that it is solved:
> https://answers.launchpad.net/dolfin/+question/143028/+confirm?answer_id=3
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/dolfin/+question/143028
>
> You received this question notification because you are a direct
> subscriber of the question.

Revision history for this message
Johannes Ring (johannr) said :
#6

Great! It is nice to see that someone is trying out this Mac binary. This is actually the first response after about 140 downloads.

Btw, could you change status to 'solved'?

Revision history for this message
Best Anders Logg (logg) said :
#7

On Thu, Jan 27, 2011 at 08:42:41AM -0000, Stig Larsson wrote:
> Question #143028 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/143028
>
> Status: Answered => Open
>
> Stig Larsson is still having a problem:
> It works! Thanks! /stig

Great! :-)

--
Anders

Revision history for this message
Stig Larsson (stig-chalmers) said :
#8

Thanks Anders Logg, that solved my question.