UFC

UFC won't build with locally installed SWIG

Bug #490785 reported by Garth Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UFC
Fix Released
High
Johannes Ring

Bug Description

The SWIG extension won't build with SWIG installed locally but still in a user's path.

$ scons
scons: Reading SConscript files ...
Checking for SWIG...(cached) yes
Checking for SWIG version > 1.3.35...(cached) yes
Checking for Boost...(cached) yes
Checking for Python...(cached) yes
scons: done reading SConscript files.
scons: Building targets ...
swig -o src/ufc/ufc_wrap.cc -python -c++ -shadow -O src/ufc/ufc.i
c++ -o src/ufc/ufc_wrap.os -c -fPIC -I/usr/include -I/usr/include/python2.6 -Isrc/ufc src/ufc/ufc_wrap.cc
c++ -o src/ufc/_ufc.so -shared src/ufc/ufc_wrap.os
scons: done building targets.

$ sudo scons install
scons: Reading SConscript files ...
Checking for SWIG...(cached) no
scons: done reading SConscript files.
scons: Building targets ...
scons: `install' is up to date.
scons: done building targets.

*** Warning: swig not found.
Python extension module will not be installed.

Revision history for this message
Garth Wells (garth-wells) wrote :

I suspect this it due to Python being called by the root user when doing 'sudo scons install'. root does not known where the user installed UFC.

Changed in ufc:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Johannes Ring (johannr)
Changed in ufc:
milestone: none → 1.2.1
Revision history for this message
Johannes Ring (johannr) wrote :

When running a command using sudo the environment is completely different than what it is when running as a regular user. Therefore it is quite understandable that a locally installed SWIG is not found. I guess a possible solution is to add an option for setting the path to the SWIG executable, e.g. withSwig=/path/to/local/swig.

Revision history for this message
Garth Wells (garth-wells) wrote :

I think the problem is that 'scons install' wants to use SWIG, but it shouldn't. I first did

  $ scons

which should configure and build (and use SWIG). Then,

 $ sudo scons install

should just install the files.

Revision history for this message
FEniCS JHBuildbot (jhbuildbot) wrote :

Sorry, scons doesn't work like that. You don't even have to run it as a two step procedure (build and install), 'scons install' is enough.

Revision history for this message
Garth Wells (garth-wells) wrote :

Resolved with move to CMake.

Changed in ufc:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.