Build error with SWIG 3.0.6

Issue #28 resolved
Asbjørn Nilsen Riseth created an issue

Hi,

I'm trying to build mshr with a local SWIG 3.0.6 installation, and get an error during the build of mshrable. I've included the failing stages of cmake below.

[ 87%] Building CXX object CMakeFiles/mshr.dir/src/CSGPrimitives2D.cpp.o
[ 90%] Building CXX object CMakeFiles/mshr.dir/src/CSGCGALDomain2D.cpp.o
Linking CXX shared library libmshr.so
[ 90%] Built target mshr
[ 93%] Scanning dependencies of target mshrable
Swig source
[ 96%] Building CXX object CMakeFiles/mshrable.dir/app/mshrable.cpp.o
/scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/mshr/swig/mshr.i:158: Error: Line indented less than expected (line 5 of pythoncode)
make[2]: *** [swig/mshrPYTHON_wrap.cxx] Error 1
make[1]: *** [swig/CMakeFiles/_mshr.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin/io/HDF5Attribute.h:30:0,
                 from /scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin/io/HDF5File.h:32,
                 from /scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin/io/dolfin_io.h:9,
                 from /scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin.h:37,
                 from /scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/mshr/app/mshrable.cpp:20:
/scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin/io/HDF5Interface.h: In static member function ‘static void dolfin::HDF5Interface::add_attribute_value(hid_t, std::string, const T&) [with T = std::basic_string<char>; hid_t = int; std::string = std::basic_string<char>]’:
/scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin/io/HDF5Interface.h:546:12: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
     herr_t status = H5Tset_size(datatype_id, attribute_value.size());
            ^
/scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin/io/HDF5Interface.h: In static member function ‘static void dolfin::HDF5Interface::get_attribute_value(hid_t, hid_t, T&) [with T = std::basic_string<char>; hid_t = int]’:
/scratch/riseth/install-scripts/dolfin/fenics-dev-20150724/src/dolfin/local/include/dolfin/io/HDF5Interface.h:629:12: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
     herr_t status = H5Tset_size(memtype, string_length);
            ^
Linking CXX executable mshrable
[ 96%] Built target mshrable

Comments (6)

  1. Benjamin Dam Kehlet

    Seems like swig is complaining about the indentation of some python code in the interface file. Could you run "make VERBOSE=1" a paste the relevant part of the output where the python bindings are built (ie. the part below the "Swig source" message)

  2. Benjamin Dam Kehlet

    There was a change in swig between 3.0.5 and 3.0.6 that led to this error. Could you check that it works now?

  3. Log in to comment