From bug-octave-request at bevo dot che dot wisc dot edu Sun Dec 19 10:33:33 1999 Subject: Cross-compilation From: Hagen Gilsing To: bug-octave at bevo dot che dot wisc dot edu Date: Sun, 19 Dec 1999 10:33:37 -0600 (CST) Description: ------------ I tried to cross-compile Octave-2.1.13 for Windows-NT. Following the instructions in README.Windows, I got a complete cdk-b19/b20-binary distribution (ftp://ftp.espci.fr/pub/NT/GNU-win32/beta19) copied the cdk-b19/b20 libs/includes copied the termcap files cross-compiled the binutils (2.9.1, target i386-cygwin32) cross-compiled a gnu-compiler (egcs-2.91.60, target i386-cygwin32) reset the path for cross-compilation (Octave) cross-compiled the Octave-2.1.13 sources without error generated a Octave-binary distribution installed the Octave-binary distribution under NT into the branch //C/Linux1 (setting OCTAVE_HOME) Calling octave under NT results in the error message fatal: invalid password object Reason: ------- 1. cdk comes with a headerfile pwd.h including the lines 44-48: #ifndef _POSIX_SOURCE #define _PATH_PASSWD "/etc/passwd" #define _PASSWORD_LEN 128 /* max length, not counting NULL */ #endif When building the cross-compiler in described way, the flag _POSIX_SOURCE is set, so that the passwd-file is expected to be in /etc. 2. If no passwd information is available, under cdk a user starts in a default mode: uid=500. 3. Compiling Octave with the cross-compiler in the described way, the flags HAVE_PWD_H etc.are set. That's way, on startup Octave inits the environmental information. As a part of it, it calls octave_env::[do_get_home_directory|do_get_user_directory] and octave_passwd pw = octave_passwd::getpwuid (octave_syscalls::getuid ()); octave_passwd::getpwuid tries to find out user data via ::getpwuid (uid). If file _PATH_PASSWD (/etc/passwd) does not exist or the the user with the uid returned by ::getuid () is not registered, the octave_passwd-structure pw is inited with a valid flag set to false. This causes the call of octave_passwd::gripe_invalid and exit via (*current_liboctave_error_handler) ("invalid password object") For details see liboctave/[oct-env|oct-passwd].[h|cc]. Proposal: --------- I would propose to update the file README.Windows : - I couldn't find termcap-1.3.tar.gz under ftp://ftp.gnu.org/pub/gnu. - The link to Mumit Khan's WWW-page could possibly be replaced by http://www.nanotech.wisc.edu/~khan - The description of installing octave by crosscompilation should include information + to check pwd.h for the expected path to passwd + to setup user information in passwd (the existance of the file is not sufficient) + to adapt the executing path (1st line) in install-octave, mkinstalldirs in Octave's binary distribution. + to adapt the executing path (1st line) in bin/octave after having installed octave --- README.Windows Sun Dec 19 02:52:48 1999 +++ README.Windows Sun Dec 19 02:52:14 1999 at @ -93,8 +93,24 @@ make -f octMakefile binary-dist - + copy the binary distribution to your Windows system and install - using the intall-octave shell script + + copy the binary distribution to your Windows system. Install-octave + will create executables octave, octave-bugs, octave.bin. Check the + target directory for existing files and, if necessary, make a backup + of them befor installation. + + cdk provides an . Octave will therefore expect information + in file passwd on startup. Check for the default place of + passwd and create a passwd, that holds the user who can start + octave. Insufficient specification can result in error messages + "invalid password object". + + The installation uses the two scripts install-octave and mkinstalldirs. + If necessary, adapt the first line in both of them for an correct + call of sh. + + Install using the intall-octave shell script. After the call of + install-octave check also the first line of the wrapper script octave + for a valid executable. * Octave requires gnuplot for plotting, but the normal Windows version of gnuplot will not work because it only reads from the GUI and refuses - It would be helpful to add information to install info, as it is an integral part of Octave's "help-system", maybe a reference to web2c or something like this. I would propose: - to be as strict under NT/Windows as under UNIX and to version the executables as it is done per default under Linux, that means install: octave- instead of octave octave-bugs- instead of octave-bugs octave.bin- instead of octave.bin and to adapt the Octave-Wrapper for it - to change the line 19 in the Octave-Wrapper. The reason for it is, that in case of errors, Octave call's exit. This also closes the calling shell and one cannot anymore read possible error messages. Otherwise, the regular exit is not affected. --- octave-sh Sun Dec 19 02:26:52 1999 +++ octave-sh Sun Dec 19 02:26:12 1999 at @ -16,4 +16,4 @@ OCTAVE_HOME= at OCTAVE_HOME@ export OCTAVE_HOME -exec $OCTAVE_HOME/bin/octave.bin $* +(exec $OCTAVE_HOME/bin/octave.bin $*) Configuration (please do not edit this section): ----------------------------------------------- uname output: CYGWIN32_NT MERLIN 4.0 19.0 i686 unknown configure opts: --host=i386-cygwin32 Fortran compiler: g77 FFLAGS: -O F2C: F2CFLAGS: FLIBS: -lg2c -lm -L/usr/local/cross-gcc/cygnus-beta19/lib/gcc-lib/i386-cygwin32/egcs-2.91.60 -L/usr CPPFLAGS: INCFLAGS: -I/usr/local/include/octave-2.1.13/octave -I/usr/local/include C compiler: gcc, version 2.91.60 19981201 (egcs-1.1.1 release) CFLAGS: -DHAVE_CONFIG_H -mieee-fp -g -O2 -Wall CPICFLAG: -fPIC C++ compiler: c++, version 2.91.60 19981201 (egcs-1.1.1 release) CXXFLAGS: -DHAVE_CONFIG_H -mieee-fp -fno-rtti -fno-exceptions -fno-implicit-templates -g -O2 -Wall CXXPICFLAG: -fPIC LDFLAGS: -g LIBFLAGS: -L/usr/local/lib/octave-2.1.13 RLD_FLAG: TERMLIBS: -ltermcap LIBS: LEXLIB: LIBPLPLOT: LIBDLFCN: LIBGLOB: ./glob/libglob.a DEFS: -DOCTAVE_SOURCE=1 -DSEPCHAR=':' -DSEPCHAR_STR=":" -DUSE_READLINE=1 -D__NO_MATH_INLINES=1 -DCXX_NEW_FRIEND_TEMPLATE_DECL=1 -DCXX_PREPENDS_UNDERSCORE=1 -DHAVE_LIBM=1 -DF77_APPEND_UNDERSCORE=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_ALLOCA=1 -DNPOS=string::npos -DSTDC_HEADERS=1 -DHAVE_DIRENT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_ASSERT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_FLOAT_H=1 -DHAVE_GRP_H=1 -DHAVE_IEEEFP_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1 -DHAVE_PWD_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS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WITH_DYNAMIC_LINKING=1 -DHAVE_TIMEVAL=1 -DHAVE_FINITE=1 -DHAVE_ISNAN=1 -DHAVE_ISINF=1 -DHAVE_INFINITY=1 -DHAVE_ACOSH=1 -DHAVE_ASINH=1 -DHAVE_ATANH=1 -DHAVE_ERF=1 -DHAVE_ERFC=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_ST_BLOCKS=1 -DHAVE_ST_RDEV=1 -DCLOSEDIR_VOID=1 -DHAVE_GR_PASSWD=1 -DEXCEPTION_IN_MATH=1 -DRETSIGTYPE=void -DHAVE_POSIX_SIGNALS=1 -DHAVE_GETRUSAGE=1 -DHAVE_TIMES=1 -DRUSAGE_TIMES_ONLY=1 -DGNUPLOT_HAS_MULTIPLOT=1 -DGNUPLOT_HAS_FRAMES=1 ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------