From naur at post11.tele.dk Mon Jan 8 13:07:30 2007 From: naur at post11.tele.dk (Thorkil Naur) Date: Mon Jan 8 13:07:42 2007 Subject: Building Hugs on PPC Mac OS X 10.4 message: No rule to make target `../hsc2hs/Main.hs', needed by `../hugsdir/programs/hsc2hs/Main.hs'. Message-ID: <200701081907.31652.naur@post11.tele.dk> Hello all Hugs'ers, As a well-behaved boy, I try to prepare for the Hac07 event by, among other things, installing Hugs. I follow the directions on http://hackage.haskell.org/trac/hugs for getting and building a development version, cvs for hugs98, darcs for the libraries etc. All this happens on a PPC Mac OS X 10.4 with a ghc-6.4.1 installed from binary. Unfortunately, I am now stuck in the "make". Initially, I got the messages ... configure: creating ./config.status config.status: creating include/HsBaseConfig.h find: -wholename: unknown expression primary find: -wholename: unknown expression primary find: -wholename: unknown expression primary ERROR: unable to locate Prelude along new path: "libraries/bootlib" - ignoring it. ERROR: unable to locate Prelude along new path: "libraries/bootlib" - ignoring it. ERROR: unable to locate Prelude along new path: "libraries/bootlib" - ignoring it. ERROR: unable to locate Prelude along new path: "libraries/bootlib" - ignoring it. ERROR: unable to locate Prelude along new path: "libraries/bootlib" - ignoring it. ERROR: unable to locate Prelude along new path: "libraries/bootlib" - ignoring it. ERROR: unable to locate Prelude along new path: "libraries/bootlib" - ignoring it. echo timestamp for bootlib >bootlib/.stamp cd ../cpphs; HUGSFLAGS=-P../libraries/bootlib HUGSDIR=../hugsdir ../src/runhugs -98 Setup.hs configure --verbose --hugs --prefix='/usr/local' --scratchdir='../hugsdir/packages/cpphs' --with-compiler=../src/ffihugs ERROR: unable to locate Prelude along new path: "../libraries/bootlib" - ignoring it. make[1]: *** [../hugsdir/programs/cpphs/Main.hs] Error 1 make: *** [all] Error 2 and those "find: -wholename: unknown expression primary" messages made me a bit concerned: I investigated "man find" and found that the OS X 10.4 find does not have a -wholename option. Has this been tried before, i.e. boot-strapping hugs98 on a Mac OS X 10.4? In any case, on a Linux machine, "man find" says that -path is the same as -wholename, so I replaced -wholename by -path in "hugs98/libraries/tools/make_bootlib" (which is the only place I found -wholename) and tried again. And this time, I am stuck with the messages ... echo timestamp for bootlib >bootlib/.stamp cd ../cpphs; HUGSFLAGS=-P../libraries/bootlib HUGSDIR=../hugsdir ../src/runhugs -98 Setup.hs configure --verbose --hugs --prefix='/usr/local' --scratchdir='../hugsdir/packages/cpphs' --with-compiler=../src/ffihugs Configuring cpphs-1.3... configure: looking for package tool: hugs near compiler in ../src configure: found package tool in ../src/hugs configure: Using install prefix: /usr/local configure: Binaries installed in: /usr/local/bin configure: Libraries installed in: /usr/local/lib/hugs/packages/cpphs configure: Private binaries installed in: /usr/local/libexec configure: Data files installed in: /usr/local/share/cpphs-1.3 configure: Using compiler: ../src/ffihugs configure: Compiler flavor: Hugs configure: Compiler version: configure: Using package tool: ../src/hugs configure: Using ar found on system at: /usr/bin/ar configure: No haddock found configure: Using ld found on system at: /usr/bin/ld configure: No pfesetup found configure: Using ranlib found on system at: /usr/bin/ranlib configure: Using runghc found on system at: /usr/local/bin/runghc configure: No runhugs found configure: Using tar found on system at: /usr/bin/tar configure: Using happy: /usr/local/bin/happy configure: Using alex: /usr/local/bin/alex configure: Using hsc2hs: /usr/local/bin/hsc2hs configure: No c2hs found configure: No cpphs found configure: No greencard found cd ../cpphs; HUGSFLAGS=-P../libraries/bootlib HUGSDIR=../hugsdir ../src/runhugs -98 Setup.hs build --verbose Preprocessing library cpphs-1.3... Preprocessing executables for cpphs-1.3... Building cpphs-1.3... /bin/rm -f -r ../hugsdir/packages/cpphs/autogen mkdir -p ../hugsdir/programs /bin/rm -f -r ../hugsdir/programs/cpphs mv ../hugsdir/packages/cpphs/programs/cpphs ../hugsdir/programs rmdir ../hugsdir/packages/cpphs/programs (echo '#! /bin/sh'; \ echo "rootdir='`cd ..; pwd`'"; \ echo '$rootdir/src/runhugs -P$rootdir/libraries/bootlib $rootdir/hugsdir/programs/cpphs/Main.hs "$@"') >tools/cpphs chmod 755 tools/cpphs make[1]: *** No rule to make target `../hsc2hs/Main.hs', needed by `../hugsdir/programs/hsc2hs/Main.hs'. Stop. make: *** [all] Error 2 With my limited capacity, I have not managed to find a way around this obstacle. Your help to overcome this would be most welcome. I hope that I am not wasting your time. I will gladly supply additional information. And one last piece of information: I never tried to install Hugs from some binary distribution, that could very well work. Best regards Thorkil From trac at galois.com Fri Jan 19 09:16:14 2007 From: trac at galois.com (Hugs) Date: Fri Jan 19 09:11:53 2007 Subject: [Hugs] #51: The WinHugs uninstaller.exe doesn't work! In-Reply-To: <061.f364392819283d9dd8a5cbf642c957e1@localhost> References: <061.f364392819283d9dd8a5cbf642c957e1@localhost> Message-ID: <070.13a80674c8ef73260712f5dbac99c201@localhost> #51: The WinHugs uninstaller.exe doesn't work! ----------------------+----------------------------------------------------- Reporter: guest | Owner: neil Type: defect | Status: new Priority: major | Milestone: Component: winhugs | Version: current Resolution: | Keywords: setup uninstall ----------------------+----------------------------------------------------- Comment (by neil): The WinHugs installer will be entirely rewritten for the next release, using HsInstaller (still in the planning stage) and probably .msi files. This bug is pretty bad though (looks like some file went astray at some point...). I will try and replicate and get a new installer out shortly. -- Ticket URL: Hugs Hugs 98, an interpreter for Haskell From iavor.diatchki at gmail.com Sun Jan 21 21:01:19 2007 From: iavor.diatchki at gmail.com (Iavor Diatchki) Date: Sun Jan 21 20:56:47 2007 Subject: module system bug Message-ID: <5ab17e790701211801g55600f63i4c205466b79c0269@mail.gmail.com> Hello, There appears to be a problem when combinig "hiding" and "qualified" imports. Here is an example: module A where x = True module Main(main) where import qualified A hiding () main = print A.x When loading the second module (Main) Hugs (September 2006) complains that A.x is not in scope. It appears that this happens whenever there is a 'hiding' clause (it does not have to be empty) but it does not happen if the import is not qualified. -Iavor From trac at galois.com Mon Jan 22 03:17:37 2007 From: trac at galois.com (Hugs) Date: Mon Jan 22 03:13:03 2007 Subject: [Hugs] #53: qualified + hiding hides too much Message-ID: <061.b89ca33a0a01443a029ed28cef517984@localhost> #53: qualified + hiding hides too much ---------------------------+------------------------------------------------ Reporter: ross | Owner: nobody Type: defect | Status: new Priority: major | Milestone: Component: module system | Version: 200609 Keywords: | ---------------------------+------------------------------------------------ Given the following modules: {{{ module A where f = 1 g = 2 }}} {{{ module B where import qualified A hiding (f) h = A.g }}} Hugs fails with {{{ ERROR "B.hs":3 - Undefined qualified variable "A.g" }}} (reported by Iavor Diatchki) This affects variables, but not types or data constructors. -- Ticket URL: Hugs Hugs 98, an interpreter for Haskell From trac at galois.com Tue Jan 23 13:40:32 2007 From: trac at galois.com (Hugs) Date: Tue Jan 23 13:35:54 2007 Subject: [Hugs] #53: qualified + hiding hides too much In-Reply-To: <061.b89ca33a0a01443a029ed28cef517984@localhost> References: <061.b89ca33a0a01443a029ed28cef517984@localhost> Message-ID: <070.090a4cb40130ddd2be9b3fc9db76a049@localhost> #53: qualified + hiding hides too much ----------------------------+----------------------------------------------- Reporter: ross | Owner: nobody Type: defect | Status: closed Priority: major | Milestone: Component: module system | Version: 200609 Resolution: fixed | Keywords: ----------------------------+----------------------------------------------- Changes (by ross): * resolution: => fixed * status: new => closed Comment: fixed in CVS -- Ticket URL: Hugs Hugs 98, an interpreter for Haskell From trac at galois.com Tue Jan 16 14:23:00 2007 From: trac at galois.com (Hugs) Date: Mon Jan 7 05:50:21 2008 Subject: [Hugs] #52: [PATCHES] port hugs98-Sep2006 to AIX 4.3.3, AIX 5.2, HPUX 11.0, SUNOS 5.9 Message-ID: <061.ca26ea15e24020b52c20209a87d40a0a@localhost> #52: [PATCHES] port hugs98-Sep2006 to AIX 4.3.3, AIX 5.2, HPUX 11.0, SUNOS 5.9 -------------------------+-------------------------------------------------- Reporter: guest | Owner: nobody Type: enhancement | Status: new Priority: major | Milestone: Component: hugs | Version: 200609 Keywords: port | -------------------------+-------------------------------------------------- Sorry if this is a duplicate. I sent it to hugs-bugs@haskell.org but it just seems to have disappeared into the ether. Here is a shell script that I used to build the Sep 2006 release for: AIX 4.3.3 (IBM 5.0.2.0 compiler) AIX 5.2 (IBM 6.0.0.7 compiler) HPUX 11.0 (A.11.00.13 compiler) Redhat 9 x86 Redhat AS 4 x86 (CentOS actually) Solaris 9 (6.0u2 compiler) There are some source patches in the script as well as some settings that are required for proper compilation. I have a framework that runs the script in the unpacked source tree to do the build and install. Some autoconf work needs to be done for proper configuration of inline functions and shared library creation. As far as the latter goes you might consider using libtool, which is designed for that sort of thing. The current approach of using the compiler for shared library creation is not supported by HPUX 11.0 -- the link needs to be done by the linker directly. So at the very least the compiles and links need to be split into two separate commands. Some documentation for the OPTFLAGS and PTHREAD_CC variables would be nice. There is still an issue in the SUNOS build related to a couple of symbols in System/Posix/Internals.so. Hugs runs properly for what I am doing so I haven't spent time on this yet: runhugs: Error occurred ERROR "libraries/bootlib/System/Posix/Internals.hs" - Error while importing DLL "libraries/bootlib/System/Posix/Internals.so": ld.so.1: ffihugs: fatal: relocation error: file libraries/bootlib/System/Posix/Internals.so: symbol __hscore_readdir: referenced symbol not found There is also a question about the make_bootlib script -- what is "cat -s" intended to do? It is not clear to me that it is portable -- the AIX man page states that -S does what -s used to do, for example. Here is a summary of what I had to do for the various platforms to get hugs to compile and install: - AIX The AIX preprocessor fails when it sees invalid # directives. (Note that it also allows # directives to have white space or comments before the # -- it looked like some of the Haskell code in Hugs thinks spaces will prevent interference from the preprocessor.) The proper inline keyword is __inline. The _LARGE_FILES symbol collides with _LARGE_FILES_API, which latter is turned on automatically when long long is enabled (in at least one failed compilation, anyway). The hugs code has // comments in it -- this is not valid for older C compilers. Increase -qmaxmem so optimization completes without warnings. Turn on alloca support. Use -G compiler option for proper shared library support. - HPUX Added +Z to generate position independent code for shared library use. Added +DAportable so the resulting binaries can run on older PARISC version processors. Pass -b option to linker when building shared libraries. Added wrapper around ld for proper shared library linking. HPUX 11, at least the version I have, does not support linking a shared library via the compiler -- you are supposed to use the linker directly. I made a wrapper that throws away the crt0.o argument that the compiler passes to the linker and that seems to fix the problem (that particular file is not used for dynamic links and is not position-independent anyway so will cause a link failure). The HPUX compiler I have does not appear to support the inline keyword. - LINUX no changes necessary - SUNOS The SUNOS compiler I have (6.0u2) has some sort of problem with inline functions as used by Hugs in shared libraries. I converted them to "static" to work around whatever was going on. Perhaps "extern inline" is needed or some such. Set the -G option for linking shared libraries. -- Joe Buehler jbuehler@spirentcom.com {{{ #!/bin/ksh HOST="$1" OS="$2" OS_VERSION="$3" OS_VERSION_MINOR="$4" patch_aix() { /usr/local/bin/patch -p0 -N -b -Vnumbered <<\EOF --- libraries/tools/make_bootlib.~1~ 2006-05-19 17:36:17.000000000 -0400 +++ libraries/tools/make_bootlib 2007-01-09 12:50:58.000000000 -0500 @@ -62,10 +62,19 @@ # portability we run the preprocessor on a .c file. cpp_input=$tmpdir/cppinput.c - cp "$1" $cpp_input + # AIX C/C++ compiler version 6.0 fails on illegal preprocessor directives + sed ' + s/^\([ ]*#[ ]*[-!]\)/ELIMINATE THIS STRING PLEASE\1/ + s/^\([ ][ ]*#[ ]*[A-Z]\)/ELIMINATE THIS STRING PLEASE\1/ + s/^\([ ][ ]*#[ ]*osthreads\)/ELIMINATE THIS STRING PLEASE\1/ + ' "$1" >$cpp_input # gcc-3.3 on MacOS X 10.3 is reported to add #pragma - $cpp $cpp_flags $cpp_input | grep -v '^#' | cat -s + $cpp $cpp_flags $cpp_input | + sed ' + /^#/d + s/^ELIMINATE THIS STRING PLEASE// + ' | cat -s } # internal Hugs modules --- packages/base/include/HsBase.h.~1~ 2006-09-20 18:01:52.000000000 -0400 +++ packages/base/include/HsBase.h 2007-01-09 13:10:35.000000000 -0500 @@ -220,6 +220,8 @@ #ifndef INLINE # if defined(_MSC_VER) # define INLINE extern __inline +# elif defined(__xlC__) +# define INLINE __inline # elif defined(__GNUC__) # define INLINE extern inline # else EOF } patch_hpux() { /usr/local/bin/patch -p0 -N -b -Vnumbered <<\EOF --- packages/base/include/HsBase.h.~1~ 2006-09-20 18:01:52.000000000 -0400 +++ packages/base/include/HsBase.h 2007-01-09 13:10:35.000000000 -0500 @@ -220,6 +220,8 @@ #ifndef INLINE # if defined(_MSC_VER) # define INLINE extern __inline +# elif defined(__hpux) +# define INLINE static # elif defined(__GNUC__) # define INLINE extern inline # else EOF } patch_sunos() { /usr/local/bin/patch -p0 -N -b -Vnumbered <<\EOF --- packages/base/include/HsBase.h.~1~ 2006-09-20 18:01:52.000000000 -0400 +++ packages/base/include/HsBase.h 2007-01-09 13:10:35.000000000 -0500 @@ -220,6 +220,8 @@ #ifndef INLINE # if defined(_MSC_VER) # define INLINE extern __inline +# elif defined(__sun) +# define INLINE static # elif defined(__GNUC__) # define INLINE extern inline # else EOF } export CC=cc export PTHREAD_CC=cc export CFLAGS=-O export OPTFLAGS=-O case "$OS" in aix) # This is the compiler I like to use under AIX. CC=/usr/vacpp/bin/xlC_r PTHREAD_CC=/usr/vacpp/bin/xlC_r # Enable large files -- this is implied by "long long" so we turn it on globally. CFLAGS="$CFLAGS -D_LARGE_FILE_API" # Some of the C code actually has C++ commments in it! CFLAGS="$CFLAGS -qcpluscmt" # Increase memory available for optimization. CFLAGS="$CFLAGS -qmaxmem=32768" # For alloca support CFLAGS="$CFLAGS -ma" # This version of HUGS does not know how to make AIX shared objects. export ac_cv_dll_flags=-G # The _LARGE_FILES and _LARGE_FILE_API symbols are incompatible -- # defining both causes system header file conflicts (AIX 5.2.0.0) export ac_cv_sys_large_files=no patch_aix ;; hpux) # This version of HUGS does not know how to make HPUX shared objects. CFLAGS="$CFLAGS +Z +DAportable -tl,$PWD/myld" export ac_cv_dll_flags="-Wl,-b" cat >myld <<-\EOF && chmod 755 myld #!/bin/ksh I=0 J=0 SHARED= #echo "LINK: $0 $*" >&2 for ARG; do case "$ARG" in */crt0.o) ARGV[$I]="$ARG" I=$(expr $I + 1) ;; -b) SHARED=1 ARGV[$I]="$ARG" ARGV_SHARED[$J]="$ARG" I=$(expr $I + 1) J=$(expr $J + 1) ;; *) ARGV[$I]="$ARG" ARGV_SHARED[$J]="$ARG" I=$(expr $I + 1) J=$(expr $J + 1) ;; esac done if [ "$SHARED" != "" ]; then set -x ld "${ARGV_SHARED[@]}" else set -x ld "${ARGV[@]}" fi EOF patch_hpux ;; linux) ;; sunos) # This version of HUGS does not know how to make SUNOS shared objects. export ac_cv_dll_flags=-G patch_sunos ;; esac && ./configure \ CC="$CC" \ PTHREAD_CC="$CC" \ CFLAGS="$CFLAGS" \ OPTFLAGS="$OPTFLAGS" \ --disable-large-banner \ --with-pthreads \ && gmake && ( gmake verbosecheck || true ) && gmake install && true }}} -- Ticket URL: Hugs Hugs 98, an interpreter for Haskell