17 Replies Latest reply on Aug 13, 2009 4:40 PM by dgilmore

    Impossible to build from source in Ubuntu 9

    jnavia
      the program "test" doesn't have a -a option

      When building from source I get the following output

      jacob@ubuntu9-vm1:~/srcnew/x86_open64-4.2.2$ make
      make first
      make[1]: Entering directory `/home/jacob/srcnew/x86_open64-4.2.2'
      make -C osprey/targx8664_x8664/libspin
      make[2]: Entering directory `/home/jacob/srcnew/x86_open64-4.2.2/osprey/targx8664_x8664/libspin'
      make[2]: Nothing to be done for `default'.
      make[2]: Leaving directory `/home/jacob/srcnew/x86_open64-4.2.2/osprey/targx8664_x8664/libspin'
      make -C osprey/targx8664_x8664/libspin_4_2_0
      make[2]: Entering directory `/home/jacob/srcnew/x86_open64-4.2.2/osprey/targx8664_x8664/libspin_4_2_0'
      make[2]: Nothing to be done for `default'.
      make[2]: Leaving directory `/home/jacob/srcnew/x86_open64-4.2.2/osprey/targx8664_x8664/libspin_4_2_0'
      make[1]: Leaving directory `/home/jacob/srcnew/x86_open64-4.2.2'
      make phony_targets
      make[1]: Entering directory `/home/jacob/srcnew/x86_open64-4.2.2'
      make -C osprey/targx8664_x8664/include
      make[2]: Entering directory `/home/jacob/srcnew/x86_open64-4.2.2/osprey/targx8664_x8664/include'
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      test: 5: -a: unexpected operator
      mkdir: cannot create directory `cmplrs': File exists
      make[2]: *** [default] Error 1
      make[2]: Leaving directory `/home/jacob/srcnew/x86_open64-4.2.2/osprey/targx8664_x8664/include'
      make[1]: *** [include] Error 2
      make[1]: Leaving directory `/home/jacob/srcnew/x86_open64-4.2.2'
      make: *** [build] Error 2

      The problem is that the program "test" does NOT have a "-a" option

        • Impossible to build from source in Ubuntu 9
          kvikrant

          Hi,

          Have you followed the instructions in the file "INSTALL", included with the src tarball, on how to build?

          Vikrant

           

          • Impossible to build from source in Ubuntu 9
            dgilmore

            Sorry about that.  I attached a patch for a change I just committed that should allow you to build the Open64 compiler cleanly whether sh is a symbolic link to either dash or bash.

            BTW, what version of gcc/g++ is supplied with Ubuntu 9?  You will likely run into header and library problems for g++ compilation if version 4.3 or later is used (note that we only officially support our binary builds of our releases SLES10 SP2 and RHEL 5.3).

            Doug

            • Impossible to build from source in Ubuntu 9
              vanessaclark

              I was wondering that too.  If you followed the instruction on how to build it from the get go.  Why does it not have an "-a" option.  that does not seem to make any sense.  Real Estate Courses

                • Impossible to build from source in Ubuntu 9
                  dgilmore

                  In bash the implementation of test -e <path> is:

                  int
                  unary_test (op, arg)
                       char *op, *arg;
                  {
                    intmax_t r;
                    struct stat stat_buf;

                    switch (op[1])
                      {
                      case 'a':                   /* file exists in the file system? */
                      case 'e':
                        return (test_stat (arg, &stat_buf) == 0);
                  ...

                  Note that -a is an (undocumented) alias for -e.

                  The default shell on Ubuntu is dash does not implement this undocumented alias.

                  Doug

                    • Impossible to build from source in Ubuntu 9
                      sbike

                      Thanks, I had the same problem and the patch fixes it.

                      For those trying to build under ubuntu:

                      cd /opt/pkg

                      tar xvzf /tmp/x86_open64-4.2.2.1-1.x86_64.tar.bz2

                      cd /opt/src

                      tar xvzf /tmp/x86_open64-4.2.2.1-1.src.tar.bz2

                      export TOOLROOT=/opt/pkg/x86_open64-4.2.2.1/
                      export PATH=${TOOLROOT}/bin:$PATH
                      cd x86_open64-4.2.2

                      patch -p 0 < /tmp/test_a.patch

                      Continue with the INSTALLATION instructions:

                      make all MACHINE_TYPE=i386
                      ...

                      Although it still fails for me after a good while with:

                       

                      gcc -m32 -DTARG_X8664 -DKEY -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wold-style-definition -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include \ -DTARGET_MACHINE=\"x86_64-redhat-linux\" \ -c ../../gcc/collect2.c -o collect2.o In file included from ../../gcc/collect2.c:30: ../../gcc/system.h:617:22: warning: C++ style comments are not allowed in ISO C90 ../../gcc/system.h:617:22: warning: (this will be reported only once per input file) In function ‘open’, inlined from ‘collect_execute’ at ../../gcc/collect2.c:1580: /usr/include/bits/fcntl2.h:51: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments make[3]: *** [collect2.o] Error 1 make[3]: Leaving directory `/opt/src/x86_open64-4.2.2/osprey-gcc/targia32_x8664/gcc' make[2]: *** [all-gcc] Error 2 make[2]: Leaving directory `/opt/src/x86_open64-4.2.2/osprey-gcc/targia32_x8664' make[1]: *** [cc1] Error 2 make[1]: Leaving directory `/opt/src/x86_open64-4.2.2' make: *** [build] Error 2