Neil Hopcroft

A digital misfit

More fixing of-fem-fenics build

When we last left this build there was a link error on boost::mpi::communicator::operator ompi_communicator_t*() const, there is a mailing list discussion describing a similar problem on Sparc. That discussion hints at there being multiple mpi implementations and that boost has been linked against OpenMPI while the linker has found a different implementation first.
Building libboost_mpi (and, actually, all of boost) resolves this problem.
Fixed in build 91.


Fixing of-video

The of-video project gives “warning: package video is empty”. This project also has a bootstrap script which creates a configure script which creates a Makefile. Running ./configure gives “error: Octave-Forge video package requires libavformat from FFmpeg”. A quick check shows that ffmpeg is generating only static linkage libraries, adding –enabled-shared to the ffmpeg build, adding a dependency from of-video upon ffmpeg then rebuilding ffmpeg.
However, ffmpeg now fails with “/usr/bin/ld: libavutil/color_utils.o: relocation R_X86_64_32S against `.rodata’ can not be used when making a shared object; recompile with -fPIC”. Checking the build configuration I notice that the ffmpeg build is not cleaned – cleaning the build resolves this problem, although it seems like a change to such an option should force all code to be recompiled?
Now of-video is looking in libavcodec for av_malloc, but it looks like it has been moved to libavutil, adding a patch to the configure script to pass ‘-lavutil’ to test program allows ./configure to run to completion.
Next the compilation fails:

AVHandler.cc:125:42: error: ‘av_set_parameters’ was not declared in this scope
if (av_set_parameters(av_output, NULL) < 0) { ^ AVHandler.cc:135:53: error: ‘URL_WRONLY’ was not declared in this scope if (avio_open(&av_output->pb, filename.c_str(), URL_WRONLY) < 0) { ^

These two are deprecated in ffmpeg.
I have added patches:

  • AVHandler.cc: remove call to av_set_parameters()
  • AVHandler.cc: update URL_WRONLY to AVIO_FLAG_WRITE
  • oct-avifile.h: remove DECLARE_OCTAVE_ALLOCATOR
  • oct-avifile.cc: remove DEFINE_OCTAVE_ALLOCATOR

Fixed in build 36.


Fixing of-stk

The of-stk project is a bit unusual as octave packages go, since it is intended to be usable directly on Matlab too. I have encountered and addressed some of these problems before.
I have now brought the changes I made to the original octave-packages build for stk into the of-stk project. But I don’t think they do what we need – there is a Makefile in the project directory which looks like it makes packages, but it relies upon octave being in the path, which isn’t the case in this context. I have taken the instructions generated by the makefile and put them into the of-stk build script.
Fixed in build 21.


Fixing of-optiminterp

The of-optiminterp project gives this error:
*** mkoctfile lacks Fortran 90 support
Again, there is an autogen.sh script in the src/ directory. Running this before the build gets us a bit further, but now configure reports
config.status: error: cannot find input file: `Makeconf.in’
Copying Makeconf.in from of-audio allows configure to complete, but leads to a syntax error in Makeconf where there is an unexpected DEFHAVE_LINUX_SOUNDCARD, which isn’t relevant to this project. I have added a patch to remove this.
The build then fails with a message “*** mkoctfile lacks Fortran 90 support”. Looking at the Makefile, it needs MKOCTFILE_FORTRAN_90=yes otherwise it will give this message. But MKOCTFILE_FORTRAN_90 is not set anywhere, it should be in the Makeconf file, but, probably because I’m using Makeconf from of-audio, isn’t. Adding it to the end of the file allows the make to complete and the package to install.
Fixed in build 38


Fixing of-ltfat

A quick look at the INSTALL-Octave file included in the ltfat package gives some instructions for compiling and installing the package on Octave. I have added the steps described to the of-ltfat project build script. However, it seems these steps are only for adding the current checkout to the current octave instance, not for creating and installing a package. Looking in the mat2doc directory there is a make_all_packages.sh script.
Running this script gives this error:
mkdir -p /home/susnak/Dropbox/ltfat_win64
mkdir: cannot create directory ‘/home/susnak’: Permission denied
So it looks like it is set up only for a particular developers machine. Looking inside the script, we probably only need this line:
mat2doc.py `pwd`/.. mat –script=release_keep_tests.py –octpkg –unix
I’ve added a new project for mat2doc, which also requires bibtex2html, also added as a new project. This, in turn, requires ocaml – I’ll install that from source rather than adding as a project. It also requires hevea.
mat2doc puts the output package file in $HOME/publish with the name of the project directory of-ltfat, to install it we need to rename without of- on the beginning.
Fixed in build 42.


Fixing of-optim

The of-optim package fails with:

invalid doc file format
make: *** [../doc/optim.texi] Error 25

This looks like an error extracting documentation from the code files. There is a bootstrap script in the src/ directory. But this bootstrap just does the same ‘make doc’, leading to the same error.
Looking further inside, it seems the problem is munge-texi.pl is identifying all the files as invalid, perhaps its validity test is incorrect. I have added a patch to remove the validity test and the documentation extraction appears to work from the command line.
Fixed in build 46.


Fixing of-multi-precision

The build of this project fails to find mkoctfile, in the src/Makefile there is a comment “# assumptions to make if not using ./configure script” after which it defines MKOCTFILE to $(HOME)/usr/bin/mkoctfile
Setting MKOCTFILE on the make command line can fix this, but only with make invoked directly – the octave pkg function calls make as part of its installation process.
An alternative to this is to make a link to mkoctfile in $HOME of the tomcat user.
Fixed in build 24.


Fixing of-fl-core build

The fl-core package is giving this error:

fl_compose.cc: In function ‘int get_available_cpus()’:
fl_compose.cc:757:19: error: ‘_SC_NPROCESSORS_ONLN’ was not declared in this scope
return sysconf( _SC_NPROCESSORS_ONLN);
^
fl_compose.cc:757:39: error: ‘sysconf’ was not declared in this scope
return sysconf( _SC_NPROCESSORS_ONLN);
^
make: *** [fl_compose.oct] Error 1

A quick search of the octave source code shows a potential alternative, _SC_NPROCESSORS_CONF, if _SC_NPROCESSORS_ONLN is not defined. But it also says “This works on glibc, Mac OS X 10.5, FreeBSD, AIX, OSF/1, Solaris, Cygwin, Haiku” for both CONF and ONLN.
For the moment I have replaced the call to sysconf with a hard-coded ‘1’, representing a single core. Not an ideal solution but it should work for my current purposes.
Fixed in build 23.