Loading ...
Sorry, an error occurred while loading the content.

CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

Expand Messages
  • lastsnare99
    Hello All, First time posting here, hopefully this is the right place to ask my question. I m attempting to install CNS Solve 1.3 on a handful of Intel-based
    Message 1 of 15 , Feb 8, 2011
    • 0 Attachment
      Hello All,
      First time posting here, hopefully this is the right place to ask my question.
      I'm attempting to install CNS Solve 1.3 on a handful of Intel-based Macintosh computers running OSX 10.6 at our institute.
      I managed to solve the stacksize limit error by commenting out the "unlimit" statement in the cns_solve_env file.
      However, I am getting the following error whenever I try to launch the program (typing 'cns' at the prompt):

      "/cns_solve_1.3/mac-intel-darwin/bin/cns: Bad CPU type in executable."

      I tried changing the number for processor threads (cores I think) in the cns_solve_env file, I also tried commenting out the line, but I keep getting this error.
      Just wondering if anyone has encountered and overcome this error?
      Thanks
      Nate
    • Kevin Jude
      Hi Nate, I believe this is the problem with $CNS_SOLVE/bin/getarch that came up recently. You can find the solution in the archives:
      Message 2 of 15 , Feb 8, 2011
      • 0 Attachment
        Hi Nate, I believe this is the problem with $CNS_SOLVE/bin/getarch that came up recently.  You can find the solution in the archives:

        http://tech.groups.yahoo.com/group/cnsbb/message/2011

        Best wishes
        kmj

        On Tue, Feb 8, 2011 at 10:54 AM, lastsnare99 <nmichals@...> wrote:
         

        Hello All,
        First time posting here, hopefully this is the right place to ask my question.
        I'm attempting to install CNS Solve 1.3 on a handful of Intel-based Macintosh computers running OSX 10.6 at our institute.
        I managed to solve the stacksize limit error by commenting out the "unlimit" statement in the cns_solve_env file.
        However, I am getting the following error whenever I try to launch the program (typing 'cns' at the prompt):

        "/cns_solve_1.3/mac-intel-darwin/bin/cns: Bad CPU type in executable."

        I tried changing the number for processor threads (cores I think) in the cns_solve_env file, I also tried commenting out the line, but I keep getting this error.
        Just wondering if anyone has encountered and overcome this error?
        Thanks
        Nate


      • Axel Brunger
        This should have been fixed with the latest revision (# 5) available from the CNS download site. Please download it and let me know if this latest version
        Message 3 of 15 , Feb 8, 2011
        • 0 Attachment
          This should have been fixed with the latest revision (# 5) available from the CNS download
          site.  Please download it and let me know if this latest version fixes your problem. 


          On Feb 8, 2011, at 10:54 AM, lastsnare99 wrote:

           

          Hello All,
          First time posting here, hopefully this is the right place to ask my question.
          I'm attempting to install CNS Solve 1.3 on a handful of Intel-based Macintosh computers running OSX 10.6 at our institute.
          I managed to solve the stacksize limit error by commenting out the "unlimit" statement in the cns_solve_env file.
          However, I am getting the following error whenever I try to launch the program (typing 'cns' at the prompt):

          "/cns_solve_1.3/mac-intel-darwin/bin/cns: Bad CPU type in executable."

          I tried changing the number for processor threads (cores I think) in the cns_solve_env file, I also tried commenting out the line, but I keep getting this error.
          Just wondering if anyone has encountered and overcome this error?
          Thanks
          Nate


          Axel T. Brunger
          Investigator,  Howard Hughes Medical Institute
          Professor of Molecular and Cellular Physiology
          Stanford University

          Email:  brunger@...      
          Phone:  +1 650-736-1031
          Fax:    +1 650-745-1463






        • Nate Michals
          Thank you Kevin and Alex for your suggestions. I tried both solutions (separately and together), but still encounter the same problem. (Bad CPU type in
          Message 4 of 15 , Feb 9, 2011
          • 0 Attachment

            Thank you Kevin and Alex for your suggestions.

            I tried both solutions (separately and together), but still encounter the same problem. (Bad CPU type in executable).

            To recap, I downloaded revision 5 of CNS Solve 1.3, followed the installation instructions, changed the path in the cns_solve_env file and typed the ‘source’ statement.

            I also verified that the /bin/getarch file had the following entry already:

            x86_64:Darwin:*:*)
            echo mac-intel-darwin
            exit 0 ;;

             

            my install location is in /usr/local/

            when I type

            >cns

            I get the following error in the terminal:

            -bash /usr/local/cns_solve_1.3/mac-intel-darwin/bin/cns:  Bad CPU type in executable.

             

            I happen to be running a Core Duo processor (32-bit according to Apple) on a Mac-mini, in case this is significant.

            Thanks,

             

            Nate Michals
            Jr. Systems Administrator
            Hauptman-Woodward Institute
            700 Ellicott Street
            Buffalo, NY 14203
            (716) 898-8644

             

          • Ed Pozharski
            Fully realizing how ridiculous it is for me to provide any advice on Apple products, but what does getarch returns on this system? I presume that you mean
            Message 5 of 15 , Feb 9, 2011
            • 0 Attachment
              Fully realizing how ridiculous it is for me to provide any advice on
              Apple products, but what does getarch returns on this system? I presume
              that you mean "Binary installation on Intel Macintosh running OS X" by
              "followed the installation instructions".

              The error sounds suggestive of 32-bit vs 64-bit trouble, although it
              seems that you should be fine given that Core Duo should be 32-bit and
              the binaries you presumably are using should be 32-bit as well.

              On Wed, 2011-02-09 at 09:14 -0500, Nate Michals wrote:
              >
              > Thank you Kevin and Alex for your suggestions.
              >
              > I tried both solutions (separately and together), but still encounter
              > the same problem. (Bad CPU type in executable).
              >
              > To recap, I downloaded revision 5 of CNS Solve 1.3, followed the
              > installation instructions, changed the path in the cns_solve_env file
              > and typed the ‘source’ statement.
              >
              > I also verified that the /bin/getarch file had the following entry
              > already:
              >
              > x86_64:Darwin:*:*)
              > echo mac-intel-darwin
              > exit 0 ;;
              >
              >
              >
              > my install location is in /usr/local/
              >
              > when I type
              >
              > >cns
              >
              > I get the following error in the terminal:
              >
              > -bash /usr/local/cns_solve_1.3/mac-intel-darwin/bin/cns: Bad CPU type
              > in executable.
              >
              >
              >
              > I happen to be running a Core Duo processor (32-bit according to
              > Apple) on a Mac-mini, in case this is significant.
              >
              > Thanks,
              >
              >
              >
              > Nate Michals
              > Jr. Systems Administrator
              > Hauptman-Woodward Institute
              > 700 Ellicott Street
              > Buffalo, NY 14203
              > (716) 898-8644
              >
              >
              >
              >
              >

              --
              "I'd jump in myself, if I weren't so good at whistling."
              Julian, King of Lemurs
            • Ben Eisenbraun
              Hi Nate, ... That only produces an error when running as root. The default user privilege on OS X only allows setting the max stacksize to the kernel max
              Message 6 of 15 , Feb 9, 2011
              • 0 Attachment
                Hi Nate,

                > I'm attempting to install CNS Solve 1.3 on a handful of Intel-based
                > Macintosh computers running OSX 10.6 at our institute. I managed to
                > solve the stacksize limit error by commenting out the "unlimit" statement
                > in the cns_solve_env file.

                That only produces an error when running as root. The default user
                privilege on OS X only allows setting the max stacksize to the kernel max
                stacksize. When you run as root, it actually tries to set the stacksize to
                unlimited and fails with:

                # limit stacksize unlimited
                limit: stacksize: Can't remove limit (Invalid argument)

                > However, I am getting the following error whenever I try to launch the
                > program (typing 'cns' at the prompt):
                >
                > "/cns_solve_1.3/mac-intel-darwin/bin/cns: Bad CPU type in executable."

                That looks like you are trying to run the 64-bit CNS executable on a 32-bit
                only host. What is the output of 'sysctl hw.optional.x86_64'?

                -ben

                --
                | Ben Eisenbraun
                | SBGrid Consortium | http://sbgrid.org |
                | Harvard Medical School | http://hms.harvard.edu |
              • Ben Eisenbraun
                (I added the list cc: back in for the archives.) Hi Nate, ... So that proves what you already know: you have a Core Duo machine, and those CPUs are 32-bit
                Message 7 of 15 , Feb 9, 2011
                • 0 Attachment
                  (I added the list cc: back in for the archives.)

                  Hi Nate,

                  > I typed the statement >sysctl hw.optional.x86_64
                  > And the following was returned:
                  > Hw.optional.x86_64: 0

                  So that proves what you already know: you have a Core Duo machine, and
                  those CPUs are 32-bit only.

                  The CNS binary that Axel provides is 64-bit only. Building CNS is pretty
                  straightforward though. If you don't have a license for the Intel or
                  Portland compilers, you can grab a pre-compiled gfortran from
                  hpc.sourceforge.net or build the latest version yourself or using
                  Fink/MacPorts.

                  Then it's:

                  tcsh
                  source cns_solve_env
                  make install compiler=gfortran_mp
                  make utils
                  cns # To test the binary. Do the number of threads match your CPU cores?

                  The gfortran OpenMP libraries may not be able to figure out how many CPU
                  cores you have (at least they don't on OS X PowerPC), so you may want to
                  add something like this to your environment:

                  setenv OMP_NUM_THREADS `sysctl -n hw.ncpu`

                  Have fun.

                  -ben

                  --
                  | Ben Eisenbraun
                  | SBGrid Consortium | http://sbgrid.org |
                  | Harvard Medical School | http://hms.harvard.edu |
                • Ed Pozharski
                  ... That would explain it, but then this in CNS installation instructions must be incorrect: A binary installation is available for Intel Macintosh OS X,
                  Message 8 of 15 , Feb 9, 2011
                  • 0 Attachment
                    On Wed, 2011-02-09 at 11:35 -0500, Ben Eisenbraun wrote:
                    > The CNS binary that Axel provides is 64-bit only.

                    That would explain it, but then this in CNS installation instructions
                    must be incorrect:

                    "A binary installation is available for Intel Macintosh OS X, running
                    version 10.6.2 or later. This version is compiled with the ifort
                    compiler in 32 bit mode with parallelization enabled for computing
                    intensive tasks such as FFT calculations."

                    Ed.

                    --
                    "I'd jump in myself, if I weren't so good at whistling."
                    Julian, King of Lemurs
                  • Nate Michals
                    Thanks Ben and others, here is the update so far, I installed gfortran (and gcc) from hpc.sourceforge.net, verified that they are installed by typing gcc and
                    Message 9 of 15 , Feb 9, 2011
                    • 0 Attachment
                      Thanks Ben and others, here is the update so far,

                      I installed gfortran (and gcc) from hpc.sourceforge.net, verified that they are installed by typing gcc and gfortran (without specifying anything the output is:
                      gfortran: no input files

                      so it appears that they are correctly installed.
                      however it appears that there are only 5 available options for installation compilers:
                      ifort
                      pgf95
                      ifort_i4
                      ifort_mp
                      pgf95_mp

                      I'm not sure what >make install g77install
                      Actually does, but it does work on something for a bit, and some of the statements returned are:
                      >>>>WARNING, this is an unsupported machine type
                      .....
                      *****ERROR: problem with C compiler *****
                      Make[3]: *** [c-test] Error 3
                      Fortran compiler passes test
                      ....
                      Make[4]: gcc: Bad CPU type in executable
                      Make[4]: *** [to_cns] Error 1
                      Make[3]: *** [utils] Error 2
                      Make[2]: *** [compile-utils] Error 2
                      Make[1]: *** [utils] Error 2

                      ....
                      Compiling: angledb.f
                      Compiling: aria.f
                      .....
                      Make[3]: gcc: Bad CPU type in executable
                      Make[3]: *** [machine_c.o] Error 1
                      Make[3]: Target '../bin/cns_solve' not remade because of errors.
                      Make[2]: *** [cns_solve] Error 2
                      Make[1]: *** [cns_solve] Error 2

                      [end]


                      If I try to specify:
                      Make install compiler=gfortran_mp
                      It is unable to locate gfortran_mp (does not appear to be a part of the gcc package installed, however I cannot locate gfortran_mp on the internet to download or install).
                      If I type: >make install compiler=gfortran
                      The returned output is:

                      >>>> Error: Makefile template for compiler gfortran is not available

                      It sounds like it cannot or will not use gfortran since there isn't a template created for it to follow.

                      The only option I haven't explored yet (since I think it requires purchasing, and would need to be funded by the investigators, I'm just the IT guy), would be to obtain ifort, ifort_i4, or ifort_mp. I can't find them available as a free download.

                      Additionally, I did install MacPorts, but haven't found these available in a package through that manager yet.

                      Nate Michals
                      Jr. Systems Administrator
                      Hauptman-Woodward Institute
                      700 Ellicott Street
                      Buffalo, NY 14203
                      (716) 898-8644


                      -----Original Message-----
                      From: Ben Eisenbraun [mailto:bene@...]
                      Sent: Wednesday, February 09, 2011 11:35 AM
                      To: Nate Michals
                      Cc: cnsbb@yahoogroups.com
                      Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                      (I added the list cc: back in for the archives.)

                      Hi Nate,

                      > I typed the statement >sysctl hw.optional.x86_64
                      > And the following was returned:
                      > Hw.optional.x86_64: 0

                      So that proves what you already know: you have a Core Duo machine, and
                      those CPUs are 32-bit only.

                      The CNS binary that Axel provides is 64-bit only. Building CNS is pretty
                      straightforward though. If you don't have a license for the Intel or
                      Portland compilers, you can grab a pre-compiled gfortran from
                      hpc.sourceforge.net or build the latest version yourself or using
                      Fink/MacPorts.

                      Then it's:

                      tcsh
                      source cns_solve_env
                      make install compiler=gfortran_mp
                      make utils
                      cns # To test the binary. Do the number of threads match your CPU cores?

                      The gfortran OpenMP libraries may not be able to figure out how many CPU
                      cores you have (at least they don't on OS X PowerPC), so you may want to
                      add something like this to your environment:

                      setenv OMP_NUM_THREADS `sysctl -n hw.ncpu`

                      Have fun.

                      -ben

                      --
                      | Ben Eisenbraun
                      | SBGrid Consortium | http://sbgrid.org |
                      | Harvard Medical School | http://hms.harvard.edu |
                    • Ben Eisenbraun
                      Hi Nate, ... That looks fine. The hpc.sourceforge.net compilers install to /usr/local/bin, so you can also run which gfortran to ensure that it s picking up
                      Message 10 of 15 , Feb 9, 2011
                      • 0 Attachment
                        Hi Nate,

                        > I installed gfortran (and gcc) from hpc.sourceforge.net, verified that
                        > they are installed by typing gcc and gfortran (without specifying
                        > anything the output is: gfortran: no input files

                        That looks fine. The hpc.sourceforge.net compilers install to
                        /usr/local/bin, so you can also run 'which gfortran' to ensure that it's
                        picking up the correct compiler.

                        > however it appears that there are only 5 available options for installation compilers:
                        > ifort
                        > pgf95
                        > ifort_i4
                        > ifort_mp
                        > pgf95_mp

                        Hmm, I hadn't realized that the gfortran option had gone away. The
                        Makefiles with the different compiler profiles are in:

                        instlib/machine/supported/mac-intel-darwin/

                        > I'm not sure what >make install g77install

                        I am reasonably certain this is not what you want.

                        > Make[4]: gcc: Bad CPU type in executable

                        That sounds like either the compiler is built for the wrong architecture or
                        you have objects built on another architecture somewhere in the build tree.

                        > Make install compiler=gfortran_mp

                        It's a build target; not an actual command. "gfortran_mp" suggests that it
                        would use the gfortran compiler with additional flags for OpenMP support.
                        See, e.g.:

                        instlib/machine/supported/linux/Makefile.header.5.gfortran_mp

                        > The only option I haven't explored yet (since I think it requires
                        > purchasing, and would need to be funded by the investigators, I'm just
                        > the IT guy), would be to obtain ifort, ifort_i4, or ifort_mp. I can't
                        > find them available as a free download.

                        Those are all Makefile targets for the Intel compiler, which as you note is
                        not free. There is an "Academic Evaluation", but it's useless, since you
                        can't actually use the resulting executables for doing research if you follow
                        their evaluation license.

                        You should be able to just copy the linux gfortran_mp Makefile to the
                        mac-intel-darwin directory, perhaps tweak the compiler flags so they are
                        better suited for a Mac and then use gfortran to build an OpenMP capable
                        version.

                        You could also send a polite request attached to a gift basket to Axel, and
                        he might build a 32-bit version for you.

                        <obplug> Or you could just join SBGrid, and I'll do all this stuff for
                        you. </obplug>

                        :-)

                        -ben

                        --
                        | Ben Eisenbraun
                        | SBGrid Consortium | http://sbgrid.org |
                        | Harvard Medical School | http://hms.harvard.edu |
                      • Nate Michals
                        Hi Pryank, Thanks for the suggestion. I tried this, and it seems to fail with the message: Installation directory: /usr/local/cns_solve_1.3/mac-intel-darwin
                        Message 11 of 15 , Feb 9, 2011
                        • 0 Attachment

                          Hi Pryank,

                          Thanks for the suggestion.  I tried this, and it seems to fail with the message:

                           

                          Installation directory: /usr/local/cns_solve_1.3/mac-intel-darwin

                          Copying files in instlib directory mac-intel-darwin to mac-intel-darwin

                          0read.me

                          Makefile.header.1.ifort

                          Makefile.header.2.pgf95

                          Makefile.header.3.ifort_i4

                          Makefile.header.4.ifort_mp

                          Makefile.header.5.pgf95_mp

                          arch_env

                          machine_c.c

                          machine_f.f

                          >>>>Error:  Makefile template for compiler gfortran is not available

                          Make: *** [install] Error 1

                           

                          Nate Michals
                          Jr. Systems Administrator
                          Hauptman-Woodward Institute
                          700 Ellicott Street
                          Buffalo, NY 14203
                          (716) 898-8644

                           

                          From: Pryank Patel [mailto:Pryank.Patel@...]
                          Sent: Wednesday, February 09, 2011 2:13 PM
                          To: Nate Michals
                          Cc: cnsbb@yahoogroups.com
                          Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                           


                          Hi Nate,
                          Have you tried:

                          make install compiler=gfortran

                          Pryank


                          On 09/02/11 18:56, Nate Michals wrote:

                           

                          Thanks Ben and others, here is the update so far,

                          I installed gfortran (and gcc) from hpc.sourceforge.net, verified that they are installed by typing gcc and gfortran (without specifying anything the output is:
                          gfortran: no input files

                          so it appears that they are correctly installed.
                          however it appears that there are only 5 available options for installation compilers:
                          ifort
                          pgf95
                          ifort_i4
                          ifort_mp
                          pgf95_mp

                          I'm not sure what >make install g77install
                          Actually does, but it does work on something for a bit, and some of the statements returned are:

                          >>>>WARNING, this is an unsupported machine type
                          .....
                          *****ERROR: problem with C compiler *****
                          Make[3]: *** [c-test] Error 3
                          Fortran compiler passes test
                          ....
                          Make[4]: gcc: Bad CPU type in executable
                          Make[4]: *** [to_cns] Error 1
                          Make[3]: *** [utils] Error 2
                          Make[2]: *** [compile-utils] Error 2
                          Make[1]: *** [utils] Error 2

                          ....
                          Compiling: angledb.f
                          Compiling: aria.f
                          .....
                          Make[3]: gcc: Bad CPU type in executable
                          Make[3]: *** [machine_c.o] Error 1
                          Make[3]: Target '../bin/cns_solve' not remade because of errors.
                          Make[2]: *** [cns_solve] Error 2
                          Make[1]: *** [cns_solve] Error 2

                          [end]

                          If I try to specify:
                          Make install compiler=gfortran_mp
                          It is unable to locate gfortran_mp (does not appear to be a part of the gcc package installed, however I cannot locate gfortran_mp on the internet to download or install).
                          If I type: >make install compiler=gfortran
                          The returned output is:

                          >>>> Error: Makefile template for compiler gfortran is not available

                          It sounds like it cannot or will not use gfortran since there isn't a template created for it to follow.

                          The only option I haven't explored yet (since I think it requires purchasing, and would need to be funded by the investigators, I'm just the IT guy), would be to obtain ifort, ifort_i4, or ifort_mp. I can't find them available as a free download.

                          Additionally, I did install MacPorts, but haven't found these available in a package through that manager yet.

                          Nate Michals
                          Jr. Systems Administrator
                          Hauptman-Woodward Institute
                          700 Ellicott Street
                          Buffalo, NY 14203
                          (716) 898-8644

                          -----Original Message-----
                          From: Ben Eisenbraun [mailto:bene@...]
                          Sent: Wednesday, February 09, 2011 11:35 AM
                          To: Nate Michals
                          Cc: cnsbb@yahoogroups.com
                          Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                          (I added the list cc: back in for the archives.)

                          Hi Nate,

                          > I typed the statement >sysctl hw.optional.x86_64
                          > And the following was returned:
                          > Hw.optional.x86_64: 0

                          So that proves what you already know: you have a Core Duo machine, and
                          those CPUs are 32-bit only.

                          The CNS binary that Axel provides is 64-bit only. Building CNS is pretty
                          straightforward though. If you don't have a license for the Intel or
                          Portland compilers, you can grab a pre-compiled gfortran from
                          hpc.sourceforge.net or build the latest version yourself or using
                          Fink/MacPorts.

                          Then it's:

                          tcsh
                          source cns_solve_env
                          make install compiler=gfortran_mp
                          make utils
                          cns # To test the binary. Do the number of threads match your CPU cores?

                          The gfortran OpenMP libraries may not be able to figure out how many CPU
                          cores you have (at least they don't on OS X PowerPC), so you may want to
                          add something like this to your environment:

                          setenv OMP_NUM_THREADS `sysctl -n hw.ncpu`

                          Have fun.

                          -ben

                          --
                          | Ben Eisenbraun
                          | SBGrid Consortium | http://sbgrid.org |
                          | Harvard Medical School | http://hms.harvard.edu |

                        • Nate Michals
                          Hi Ben, I ll tinker with the Makefiles per your suggestion and see if I can make some progress. Thanks again ! ... Nate Michals Jr. Systems Administrator
                          Message 12 of 15 , Feb 9, 2011
                          • 0 Attachment
                            Hi Ben,
                            I'll tinker with the Makefiles per your suggestion and see if I can make some progress.
                            Thanks again !
                            :-)

                            Nate Michals
                            Jr. Systems Administrator
                            Hauptman-Woodward Institute
                            700 Ellicott Street
                            Buffalo, NY 14203
                            (716) 898-8644


                            -----Original Message-----
                            From: Ben Eisenbraun [mailto:bene@...]
                            Sent: Wednesday, February 09, 2011 2:28 PM
                            To: Nate Michals
                            Cc: cnsbb@yahoogroups.com
                            Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                            Hi Nate,

                            > I installed gfortran (and gcc) from hpc.sourceforge.net, verified that
                            > they are installed by typing gcc and gfortran (without specifying
                            > anything the output is: gfortran: no input files

                            That looks fine. The hpc.sourceforge.net compilers install to
                            /usr/local/bin, so you can also run 'which gfortran' to ensure that it's
                            picking up the correct compiler.

                            > however it appears that there are only 5 available options for installation compilers:
                            > ifort
                            > pgf95
                            > ifort_i4
                            > ifort_mp
                            > pgf95_mp

                            Hmm, I hadn't realized that the gfortran option had gone away. The
                            Makefiles with the different compiler profiles are in:

                            instlib/machine/supported/mac-intel-darwin/

                            > I'm not sure what >make install g77install

                            I am reasonably certain this is not what you want.

                            > Make[4]: gcc: Bad CPU type in executable

                            That sounds like either the compiler is built for the wrong architecture or
                            you have objects built on another architecture somewhere in the build tree.

                            > Make install compiler=gfortran_mp

                            It's a build target; not an actual command. "gfortran_mp" suggests that it
                            would use the gfortran compiler with additional flags for OpenMP support.
                            See, e.g.:

                            instlib/machine/supported/linux/Makefile.header.5.gfortran_mp

                            > The only option I haven't explored yet (since I think it requires
                            > purchasing, and would need to be funded by the investigators, I'm just
                            > the IT guy), would be to obtain ifort, ifort_i4, or ifort_mp. I can't
                            > find them available as a free download.

                            Those are all Makefile targets for the Intel compiler, which as you note is
                            not free. There is an "Academic Evaluation", but it's useless, since you
                            can't actually use the resulting executables for doing research if you follow
                            their evaluation license.

                            You should be able to just copy the linux gfortran_mp Makefile to the
                            mac-intel-darwin directory, perhaps tweak the compiler flags so they are
                            better suited for a Mac and then use gfortran to build an OpenMP capable
                            version.

                            You could also send a polite request attached to a gift basket to Axel, and
                            he might build a 32-bit version for you.

                            <obplug> Or you could just join SBGrid, and I'll do all this stuff for
                            you. </obplug>

                            :-)

                            -ben

                            --
                            | Ben Eisenbraun
                            | SBGrid Consortium | http://sbgrid.org |
                            | Harvard Medical School | http://hms.harvard.edu |
                          • Nate Michals
                            Hi Pryank, I copied the file over as Makefile.header.2.gfortran, and just in case it might conflict, I renamed Makefile.header.2.pgf95 to
                            Message 13 of 15 , Feb 9, 2011
                            • 0 Attachment

                              Hi Pryank,

                              I copied the file over as Makefile.header.2.gfortran, and just in case it might conflict, I renamed Makefile.header.2.pgf95 to Makefile.header.6.pgf95.

                              Re-ran the compiler and now I am getting specific errors regarding the C compiler.

                              If I simply type

                              >gcc or

                              >g++

                              I also get the errors:

                              /usr/local/bin/g++: Bad CPU type in executable

                              /usr/local/bin/gcc: Bad CPU type in executable

                               

                              Might it possible that I have a non-functioning g++ or gcc installation ?

                              I have installed both gcc-snwleo-intel-bin and gfortran-snwleo-intel-bin from hpc.sourceforge.net

                               

                               

                              Nate Michals
                              Jr. Systems Administrator
                              Hauptman-Woodward Institute
                              700 Ellicott Street
                              Buffalo, NY 14203
                              (716) 898-8644

                               

                              From: Patel, Pryank [mailto:Pryank.Patel@...]
                              Sent: Wednesday, February 09, 2011 4:03 PM
                              To: Nate Michals
                              Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                               

                               

                              Hi Nate,

                              I thought the appropriate Makefile would have been present. Ok, this is a hunch - try copying the Makefile.header.2.gfortran file from the cns_solve_1.3/instlib/machine/supported/linux directory to cns_solve_1.3/instlib/machine/mac-intel-darwin and try again with the same compilation option. Some of the flags may not be correct, but let's see if we can get further.

                               

                              Pryank

                               

                               

                              On 9 Feb 2011, at 20:41, Nate Michals wrote:



                               

                               

                              Hi Pryank,

                              Thanks for the suggestion.  I tried this, and it seems to fail with the message:

                               

                              Installation directory: /usr/local/cns_solve_1.3/mac-intel-darwin

                              Copying files in instlib directory mac-intel-darwin to mac-intel-darwin

                              0read.me

                              Makefile.header.1.ifort

                              Makefile.header.2.pgf95

                              Makefile.header.3.ifort_i4

                              Makefile.header.4.ifort_mp

                              Makefile.header.5.pgf95_mp

                              arch_env

                              machine_c.c

                              machine_f.f

                              >>>>Error:  Makefile template for compiler gfortran is not available

                              Make: *** [install] Error 1

                               

                              Nate Michals
                              Jr. Systems Administrator
                              Hauptman-Woodward Institute
                              700 Ellicott Street
                              Buffalo, NY 14203
                              (716) 898-8644

                               

                              From: Pryank Patel [mailto:Pryank.Patel@...]
                              Sent: Wednesday, February 09, 2011 2:13 PM
                              To: Nate Michals
                              Cc: cnsbb@yahoogroups.com
                              Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                               


                              Hi Nate,
                              Have you tried:

                              make install compiler=gfortran

                              Pryank


                              On 09/02/11 18:56, Nate Michals wrote:

                               

                              Thanks Ben and others, here is the update so far,

                              I installed gfortran (and gcc) from hpc.sourceforge.net, verified that they are installed by typing gcc and gfortran (without specifying anything the output is:
                              gfortran: no input files

                              so it appears that they are correctly installed.
                              however it appears that there are only 5 available options for installation compilers:
                              ifort
                              pgf95
                              ifort_i4
                              ifort_mp
                              pgf95_mp

                              I'm not sure what >make install g77install
                              Actually does, but it does work on something for a bit, and some of the statements returned are:

                              >>>>WARNING, this is an unsupported machine type
                              .....
                              *****ERROR: problem with C compiler *****
                              Make[3]: *** [c-test] Error 3
                              Fortran compiler passes test
                              ....
                              Make[4]: gcc: Bad CPU type in executable
                              Make[4]: *** [to_cns] Error 1
                              Make[3]: *** [utils] Error 2
                              Make[2]: *** [compile-utils] Error 2
                              Make[1]: *** [utils] Error 2

                              ....
                              Compiling: angledb.f
                              Compiling: aria.f
                              .....
                              Make[3]: gcc: Bad CPU type in executable
                              Make[3]: *** [machine_c.o] Error 1
                              Make[3]: Target '../bin/cns_solve' not remade because of errors.
                              Make[2]: *** [cns_solve] Error 2
                              Make[1]: *** [cns_solve] Error 2

                              [end]

                              If I try to specify:
                              Make install compiler=gfortran_mp
                              It is unable to locate gfortran_mp (does not appear to be a part of the gcc package installed, however I cannot locate gfortran_mp on the internet to download or install).
                              If I type: >make install compiler=gfortran
                              The returned output is:

                              >>>> Error: Makefile template for compiler gfortran is not available

                              It sounds like it cannot or will not use gfortran since there isn't a template created for it to follow.

                              The only option I haven't explored yet (since I think it requires purchasing, and would need to be funded by the investigators, I'm just the IT guy), would be to obtain ifort, ifort_i4, or ifort_mp. I can't find them available as a free download.

                              Additionally, I did install MacPorts, but haven't found these available in a package through that manager yet.

                              Nate Michals
                              Jr. Systems Administrator
                              Hauptman-Woodward Institute
                              700 Ellicott Street
                              Buffalo, NY 14203
                              (716) 898-8644

                              -----Original Message-----
                              From: Ben Eisenbraun [mailto:bene@...]
                              Sent: Wednesday, February 09, 2011 11:35 AM
                              To: Nate Michals
                              Cc: cnsbb@yahoogroups.com
                              Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                              (I added the list cc: back in for the archives.)

                              Hi Nate,

                              > I typed the statement >sysctl hw.optional.x86_64
                              > And the following was returned:
                              > Hw.optional.x86_64: 0

                              So that proves what you already know: you have a Core Duo machine, and
                              those CPUs are 32-bit only.

                              The CNS binary that Axel provides is 64-bit only. Building CNS is pretty
                              straightforward though. If you don't have a license for the Intel or
                              Portland compilers, you can grab a pre-compiled gfortran from
                              hpc.sourceforge.net or build the latest version yourself or using
                              Fink/MacPorts.

                              Then it's:

                              tcsh
                              source cns_solve_env
                              make install compiler=gfortran_mp
                              make utils
                              cns # To test the binary. Do the number of threads match your CPU cores?

                              The gfortran OpenMP libraries may not be able to figure out how many CPU
                              cores you have (at least they don't on OS X PowerPC), so you may want to
                              add something like this to your environment:

                              setenv OMP_NUM_THREADS `sysctl -n hw.ncpu`

                              Have fun.

                              -ben

                              --
                              | Ben Eisenbraun
                              | SBGrid Consortium | http://sbgrid.org |
                              | Harvard Medical School | http://hms.harvard.edu |

                               

                               

                            • Nate Michals
                              Update so far, I tested on a 64-bit Mac and didn t get the Bad CPU type in executable message. It still didn t install correctly but perhaps I m getting
                              Message 14 of 15 , Feb 10, 2011
                              • 0 Attachment

                                Update so far, I tested on a 64-bit Mac and didn’t get the “Bad CPU type in executable” message.  It still didn’t install correctly but perhaps I’m getting closer.  I followed the procedure copying /cns_solve_1.3/instlib/machine/supported/linux/Makefile.header.2.gfortran

                                Into the directory:

                                /cns_solve_1.3/instlib/machine/supported/mac-intel-darwin/

                                And renamed Makefile.header.2.pgf95 to Makefile.header.6.pgf95, in case there is  something I don’t understand yet that might conflict.

                                 

                                Here is a snippet from the end of the installation output:

                                 

                                compiling: xtarget.f

                                compiling: xutil.f

                                compiling: xyzparse.f

                                 

                                compiling: dmemory.c

                                 

                                compiling: machine_c.c

                                 

                                linking: cns_solve

                                 

                                Undefined symbols:

                                  "_csatty_", referenced from:

                                      _vchktt_ in machine_f.o

                                  "_outbuf_", referenced from:

                                      _vopen_ in machine_f.o

                                  "_cnscalloc_", referenced from:

                                      _chkalloc_ in heap.o

                                  "_cnsqalloc_", referenced from:

                                      _qryalloc_ in heap.o

                                  "_cns0alloc_", referenced from:

                                      _inithp_ in heap.o

                                  "_cnsqptrsz_", referenced from:

                                      _cnsheader_ in cns.o

                                  "_cnsialloc_", referenced from:

                                      _chkalloc_ in heap.o

                                ld: symbol(s) not found

                                collect2: ld returned 1 exit status

                                problems with new executable - old version retained

                                [Rusty:/usr/local/cns_solve_1.3] root# cns

                                cns: Command not found.

                                [Rusty:/usr/local/cns_solve_1.3] root# which cns

                                cns: Command not found.

                                 

                                So, it’s still not quite right, but I’ll keep working at it.

                                Thanks again, to all, for your assistance.

                                 

                                 

                                Nate Michals

                                 

                                From: Nate Michals [mailto:nmichals@...]
                                Sent: Wednesday, February 09, 2011 9:14 AM
                                To: cnsbb@yahoogroups.com
                                Subject: Re: [cnsbb] CNS Solve 1.3, "Bad CPU Type in Executable", OSX 10.6.6, Intel

                                 

                                 

                                Thank you Kevin and Alex for your suggestions.

                                I tried both solutions (separately and together), but still encounter the same problem. (Bad CPU type in executable).

                                To recap, I downloaded revision 5 of CNS Solve 1.3, followed the installation instructions, changed the path in the cns_solve_env file and typed the ‘source’ statement.

                                I also verified that the /bin/getarch file had the following entry already:

                                x86_64:Darwin:*:*)
                                echo mac-intel-darwin
                                exit 0 ;;

                                 

                                my install location is in /usr/local/

                                when I type

                                >cns

                                I get the following error in the terminal:

                                -bash /usr/local/cns_solve_1.3/mac-i ntel-darwin/bin/cns:  Bad CPU type in executable.

                                 

                                I happen to be running a Core Duo processor (32-bit according to Apple) on a Mac-mini, in case this is significant.

                                Thanks,

                                 

                                Nate Michals
                                Jr. Systems Administrator
                                Hauptman-Woodward Institute
                                700 Ellicott Street
                                Buffalo, NY 14203
                                (716) 898-8644

                                 

                              • Ben Eisenbraun
                                Hi Nate, ... This is also due to the fact that you have a 32-bit only CPU and are trying to run 64-bit binaries. From the gcc-snwleo-intel-bin.tar.gz tarball:
                                Message 15 of 15 , Mar 5, 2011
                                • 0 Attachment
                                  Hi Nate,

                                  > I also get the errors:
                                  > /usr/local/bin/g++: Bad CPU type in executable
                                  > /usr/local/bin/gcc: Bad CPU type in executable

                                  This is also due to the fact that you have a 32-bit only CPU and are
                                  trying to run 64-bit binaries. From the gcc-snwleo-intel-bin.tar.gz
                                  tarball:

                                  $ file *
                                  cpp: Mach-O 64-bit executable x86_64
                                  g++: Mach-O 64-bit executable x86_64
                                  gcc: Mach-O 64-bit executable x86_64
                                  gcov: Mach-O 64-bit executable x86_64
                                  gfortran: Mach-O 64-bit executable x86_64

                                  So you're really going to have start at the beginning; download the GCC
                                  sources, read the manual section on installation and build yourself a
                                  functioning 32-bit gcc/gfortran for your system. Then you can try to build
                                  CNS.

                                  My notes for building a custom gcc/gfortran/etc are below. You want to
                                  change the configure paths to better match your system, and I suggest you
                                  rev the version number in the prefix to match the one you build.

                                  -ben

                                  == Preparing the build ==
                                  You need the GCC tarball as well as GMP, MPC and MPFR tarballs. If the
                                  sources for those are found in the GCC source directory, they will be built
                                  along with GCC, and the installation will be less dependent on system
                                  libraries.

                                  {{{
                                  tar xzf gcc-X.Y.Z.tar.gz
                                  tar xzf gmp-X.Y.Z.tar.gz
                                  tar xzf mpc-X.Y.tar.gz
                                  tar xzf mpfr-X.Y.Z.tar.gz

                                  mv gmp-X.Y.Z gcc-X.Y.Z/gmp
                                  mv mpc-X.Y gcc-X.Y.Z/mpc
                                  mv mpfr-X.Y.Z gcc-X.Y.Z/mpfr
                                  }}}

                                  Don't build in the source directory itself. See below.

                                  == OS X Intel ==
                                  Same prep work and build style for the OS X builds:
                                  {{{
                                  mkdir gcc-build
                                  cd gcc-build
                                  unset DYLD_LIBRARY_PATH CFLAGS LDFLAGS
                                  ../gcc-4.4.0/configure --prefix=/build/compilers/osx.i386/gnu/4.4.0
                                  --enable-languages=c,fortran,c++,objc,obj-c++
                                  --enable-version-specific-runtime-libs --enable-checking=release
                                  --program-suffix=-4.4.0
                                  make
                                  make install
                                  }}}

                                  --
                                  | Ben Eisenbraun
                                  | SBGrid Consortium | http://sbgrid.org |
                                  | Harvard Medical School | http://hms.harvard.edu |
                                Your message has been successfully submitted and would be delivered to recipients shortly.