Thread: compiling a program that uses the SAC I/O library

Started: 2016-11-03 18:45:34
Last activity: 2016-11-04 03:35:15
Topics: SAC Help
Derek Schutt
2016-11-03 18:45:34
Hi,

I'm trying unsuccessfully to compile a fortran program using the SAC
provided i/o libraries, but I am getting an error message that is
confusing me. I'm using sac 101.6a, and the libraries I need are at
/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib.

*% gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
`/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/bin/sac-config
--cflags --libs
--prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib sacio" `*

f951: Warning: Nonexistent include directory ‘/usr/local/sac/include’
[-Wmissing-include-dirs]
/tmp/ccLy95iX.o: In function `MAIN__':
rdsetupsimul.1.brfix.f:(.text+0x1218): undefined reference to `rsac1_'
rdsetupsimul.1.brfix.f:(.text+0x1265): undefined reference to `getfhv_'
rdsetupsimul.1.brfix.f:(.text+0x12ae): undefined reference to `getfhv_'
rdsetupsimul.1.brfix.f:(.text+0x12f7): undefined reference to `getfhv_'
rdsetupsimul.1.brfix.f:(.text+0x1340): undefined reference to `getfhv_'
rdsetupsimul.1.brfix.f:(.text+0x1389): undefined reference to `getfhv_'
/tmp/ccLy95iX.o:rdsetupsimul.1.brfix.f:(.text+0x13d2): more undefined
references to `getfhv_' follow
/tmp/ccLy95iX.o: In function `MAIN__':
rdsetupsimul.1.brfix.f:(.text+0x13fd): undefined reference to `getkhv_'
collect2: error: ld returned 1 exit status

I guess I don't understand why it is wanting regarding
/usr/local/sac/include if I am giving it the prefix input.

Note that this gives me what I expect:

*% sac-config --libs
--prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib" *

namely, what I input:

-L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib

and I have confirmed this it the correct path to the libraries.


Thanks,

Derek



  • Derek,

    Try added sacio to the sac-config command

    % sac-config --libs sacio
    -L/usr/local/sac/lib -lsacio

    You only have the path and are missing the library.

    Brian

    On Nov 3, 2016, at 3:19 PM, Derek Schutt wrote:

    Hi,

    I'm trying unsuccessfully to compile a fortran program using the SAC provided i/o libraries, but I am getting an error message that is confusing me. I'm using sac 101.6a, and the libraries I need are at /usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib.

    % gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/bin/sac-config --cflags --libs --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib sacio" `

    f951: Warning: Nonexistent include directory ‘/usr/local/sac/include’ [-Wmissing-include-dirs]
    /tmp/ccLy95iX.o: In function `MAIN__':
    rdsetupsimul.1.brfix.f:(.text+0x1218): undefined reference to `rsac1_'
    rdsetupsimul.1.brfix.f:(.text+0x1265): undefined reference to `getfhv_'
    rdsetupsimul.1.brfix.f:(.text+0x12ae): undefined reference to `getfhv_'
    rdsetupsimul.1.brfix.f:(.text+0x12f7): undefined reference to `getfhv_'
    rdsetupsimul.1.brfix.f:(.text+0x1340): undefined reference to `getfhv_'
    rdsetupsimul.1.brfix.f:(.text+0x1389): undefined reference to `getfhv_'
    /tmp/ccLy95iX.o:rdsetupsimul.1.brfix.f:(.text+0x13d2): more undefined references to `getfhv_' follow
    /tmp/ccLy95iX.o: In function `MAIN__':
    rdsetupsimul.1.brfix.f:(.text+0x13fd): undefined reference to `getkhv_'
    collect2: error: ld returned 1 exit status

    I guess I don't understand why it is wanting regarding /usr/local/sac/include if I am giving it the prefix input.
    Note that this gives me what I expect:

    % sac-config --libs --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib"
    namely, what I input:

    -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib

    and I have confirmed this it the correct path to the libraries.


    Thanks,

    Derek


    ----------------------
    SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

    Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/


    • Thanks Brian,

      It's been ages since I've tried to compile code, so I may be doing
      something clueless here, but it seems that sac-config is choking.
      Based on (my misunderstanding of?) your advice, I've tried:

      *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config -c -l sacio
      -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio `*

      and

      gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config --cflags
      --libs sacio -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib
      -lsacio `

      In both cases,

      I get output that suggests to me that the me that sac-config is not
      happy with the input, because it is telling me the proper usage.

      Usage: sac-config [-clvp] [--prefix[=DIR]] [--version] [--libs]
      [--cflags] libs
      GNU Fortran (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
      Copyright (C) 2015 Free Software Foundation, Inc.

      GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
      You may redistribute copies of GNU Fortran
      under the terms of the GNU General Public License.
      For more information about these matters, see the file named COPYING

      It seems gfortran is trying to compile, and isn't, as I don't see any
      compiled file output.

      Best,

      Derek




      On 11/03/2016 01:26 PM, Brian Savage wrote:
      Derek,

      Try added sacio to the sac-config command

      % sac-config --libs sacio
      -L/usr/local/sac/lib -lsacio

      You only have the path and are missing the library.

      Brian

      On Nov 3, 2016, at 3:19 PM, Derek Schutt wrote:

      Hi,

      I'm trying unsuccessfully to compile a fortran program using the SAC
      provided i/o libraries, but I am getting an error message that is
      confusing me. I'm using sac 101.6a, and the libraries I need are at
      /usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib.

      *% gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
      `/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/bin/sac-config
      --cflags --libs
      --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib
      sacio" `*

      f951: Warning: Nonexistent include directory ‘/usr/local/sac/include’
      [-Wmissing-include-dirs]
      /tmp/ccLy95iX.o: In function `MAIN__':
      rdsetupsimul.1.brfix.f:(.text+0x1218): undefined reference to `rsac1_'
      rdsetupsimul.1.brfix.f:(.text+0x1265): undefined reference to `getfhv_'
      rdsetupsimul.1.brfix.f:(.text+0x12ae): undefined reference to `getfhv_'
      rdsetupsimul.1.brfix.f:(.text+0x12f7): undefined reference to `getfhv_'
      rdsetupsimul.1.brfix.f:(.text+0x1340): undefined reference to `getfhv_'
      rdsetupsimul.1.brfix.f:(.text+0x1389): undefined reference to `getfhv_'
      /tmp/ccLy95iX.o:rdsetupsimul.1.brfix.f:(.text+0x13d2): more undefined
      references to `getfhv_' follow
      /tmp/ccLy95iX.o: In function `MAIN__':
      rdsetupsimul.1.brfix.f:(.text+0x13fd): undefined reference to `getkhv_'
      collect2: error: ld returned 1 exit status

      I guess I don't understand why it is wanting regarding
      /usr/local/sac/include if I am giving it the prefix input.

      Note that this gives me what I expect:

      *% sac-config --libs
      --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib" *

      namely, what I input:

      -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib

      and I have confirmed this it the correct path to the libraries.


      Thanks,

      Derek



      ----------------------
      SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

      Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
      Update subscription preferences at http://ds.iris.edu/account/profile/



      ----------------------
      SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

      Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
      Update subscription preferences at http://ds.iris.edu/account/profile/


      • Derek

        You want something like (without sac-config)
        gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio


        -Lpath/to/lib
        -lsacio (the library)

        Brian

        On Nov 3, 2016, at 4:21 PM, Derek Schutt wrote:

        Thanks Brian,

        It's been ages since I've tried to compile code, so I may be doing something clueless here, but it seems that sac-config is choking. Based on (my misunderstanding of?) your advice, I've tried:

        gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config -c -l sacio -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio `

        and

        gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config --cflags --libs sacio -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio `

        In both cases,

        I get output that suggests to me that the me that sac-config is not happy with the input, because it is telling me the proper usage.

        Usage: sac-config [-clvp] [--prefix[=DIR]] [--version] [--libs] [--cflags] libs
        GNU Fortran (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
        Copyright (C) 2015 Free Software Foundation, Inc.

        GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
        You may redistribute copies of GNU Fortran
        under the terms of the GNU General Public License.
        For more information about these matters, see the file named COPYING

        It seems gfortran is trying to compile, and isn't, as I don't see any compiled file output.

        Best,

        Derek



        On 11/03/2016 01:26 PM, Brian Savage wrote:
        Derek,

        Try added sacio to the sac-config command

        % sac-config --libs sacio
        -L/usr/local/sac/lib -lsacio

        You only have the path and are missing the library.

        Brian

        On Nov 3, 2016, at 3:19 PM, Derek Schutt wrote:

        Hi,

        I'm trying unsuccessfully to compile a fortran program using the SAC provided i/o libraries, but I am getting an error message that is confusing me. I'm using sac 101.6a, and the libraries I need are at /usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib.

        % gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/bin/sac-config --cflags --libs --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib sacio" `

        f951: Warning: Nonexistent include directory ‘/usr/local/sac/include’ [-Wmissing-include-dirs]
        /tmp/ccLy95iX.o: In function `MAIN__':
        rdsetupsimul.1.brfix.f:(.text+0x1218): undefined reference to `rsac1_'
        rdsetupsimul.1.brfix.f:(.text+0x1265): undefined reference to `getfhv_'
        rdsetupsimul.1.brfix.f:(.text+0x12ae): undefined reference to `getfhv_'
        rdsetupsimul.1.brfix.f:(.text+0x12f7): undefined reference to `getfhv_'
        rdsetupsimul.1.brfix.f:(.text+0x1340): undefined reference to `getfhv_'
        rdsetupsimul.1.brfix.f:(.text+0x1389): undefined reference to `getfhv_'
        /tmp/ccLy95iX.o:rdsetupsimul.1.brfix.f:(.text+0x13d2): more undefined references to `getfhv_' follow
        /tmp/ccLy95iX.o: In function `MAIN__':
        rdsetupsimul.1.brfix.f:(.text+0x13fd): undefined reference to `getkhv_'
        collect2: error: ld returned 1 exit status

        I guess I don't understand why it is wanting regarding /usr/local/sac/include if I am giving it the prefix input.
        Note that this gives me what I expect:

        % sac-config --libs --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib"
        namely, what I input:

        -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib

        and I have confirmed this it the correct path to the libraries.


        Thanks,

        Derek


        ----------------------
        SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

        Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
        Update subscription preferences at http://ds.iris.edu/account/profile/



        ----------------------
        SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

        Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
        Update subscription preferences at http://ds.iris.edu/account/profile/


        ----------------------
        SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

        Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
        Update subscription preferences at http://ds.iris.edu/account/profile/


        • Thanks Brian,

          That worked. So, was I using sac-config unnecessarily?

          On 11/03/2016 02:26 PM, Brian Savage wrote:
          Derek

          You want something like (without sac-config)

          *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
          -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio*

          -Lpath/to/lib
          -lsacio (the library)

          Brian

          On Nov 3, 2016, at 4:21 PM, Derek Schutt wrote:

          Thanks Brian,

          It's been ages since I've tried to compile code, so I may be doing
          something clueless here, but it seems that sac-config is choking.
          Based on (my misunderstanding of?) your advice, I've tried:

          *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config -c -l
          sacio -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib
          -lsacio `*

          and

          gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config --cflags
          --libs sacio
          -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio `

          In both cases,

          I get output that suggests to me that the me that sac-config is not
          happy with the input, because it is telling me the proper usage.

          Usage: sac-config [-clvp] [--prefix[=DIR]] [--version] [--libs]
          [--cflags] libs
          GNU Fortran (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
          Copyright (C) 2015 Free Software Foundation, Inc.

          GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
          You may redistribute copies of GNU Fortran
          under the terms of the GNU General Public License.
          For more information about these matters, see the file named COPYING

          It seems gfortran is trying to compile, and isn't, as I don't see any
          compiled file output.

          Best,

          Derek




          On 11/03/2016 01:26 PM, Brian Savage wrote:
          Derek,

          Try added sacio to the sac-config command

          % sac-config --libs sacio
          -L/usr/local/sac/lib -lsacio

          You only have the path and are missing the library.

          Brian

          On Nov 3, 2016, at 3:19 PM, Derek Schutt wrote:

          Hi,

          I'm trying unsuccessfully to compile a fortran program using the
          SAC provided i/o libraries, but I am getting an error message that
          is confusing me. I'm using sac 101.6a, and the libraries I need
          are at /usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib.

          *% gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
          `/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/bin/sac-config
          --cflags --libs
          --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib
          sacio" `*

          f951: Warning: Nonexistent include directory
          ‘/usr/local/sac/include’ [-Wmissing-include-dirs]
          /tmp/ccLy95iX.o: In function `MAIN__':
          rdsetupsimul.1.brfix.f:(.text+0x1218): undefined reference to `rsac1_'
          rdsetupsimul.1.brfix.f:(.text+0x1265): undefined reference to `getfhv_'
          rdsetupsimul.1.brfix.f:(.text+0x12ae): undefined reference to `getfhv_'
          rdsetupsimul.1.brfix.f:(.text+0x12f7): undefined reference to `getfhv_'
          rdsetupsimul.1.brfix.f:(.text+0x1340): undefined reference to `getfhv_'
          rdsetupsimul.1.brfix.f:(.text+0x1389): undefined reference to `getfhv_'
          /tmp/ccLy95iX.o:rdsetupsimul.1.brfix.f:(.text+0x13d2): more
          undefined references to `getfhv_' follow
          /tmp/ccLy95iX.o: In function `MAIN__':
          rdsetupsimul.1.brfix.f:(.text+0x13fd): undefined reference to `getkhv_'
          collect2: error: ld returned 1 exit status

          I guess I don't understand why it is wanting regarding
          /usr/local/sac/include if I am giving it the prefix input.

          Note that this gives me what I expect:

          *% sac-config --libs
          --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib" *

          namely, what I input:

          -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib

          and I have confirmed this it the correct path to the libraries.


          Thanks,

          Derek



          ----------------------
          SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

          Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
          Update subscription preferences at http://ds.iris.edu/account/profile/



          ----------------------
          SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

          Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
          Update subscription preferences at http://ds.iris.edu/account/profile/


          ----------------------
          SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

          Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
          Update subscription preferences at http://ds.iris.edu/account/profile/



          ----------------------
          SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

          Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
          Update subscription preferences at http://ds.iris.edu/account/profile/


          • sac-config is supposed to be a shortcut to those library flags. You should
            be able to run sac-config stand-alone on the command line and see if it
            outputs the -L and -l flags properly.

            On Thu, Nov 3, 2016 at 1:31 PM Derek Schutt <schutt<at>colostate.edu> wrote:

            Thanks Brian,

            That worked. So, was I using sac-config unnecessarily?
            On 11/03/2016 02:26 PM, Brian Savage wrote:

            Derek

            You want something like (without sac-config)

            *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
            -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio*

            -Lpath/to/lib
            -lsacio (the library)

            Brian

            On Nov 3, 2016, at 4:21 PM, Derek Schutt wrote:

            Thanks Brian,

            It's been ages since I've tried to compile code, so I may be doing
            something clueless here, but it seems that sac-config is choking. Based
            on (my misunderstanding of?) your advice, I've tried:

            *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config -c -l sacio
            -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio `*

            and

            gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config --cflags
            --libs sacio -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib
            -lsacio `

            In both cases,

            I get output that suggests to me that the me that sac-config is not happy
            with the input, because it is telling me the proper usage.

            Usage: sac-config [-clvp] [--prefix[=DIR]] [--version] [--libs] [--cflags]
            libs
            GNU Fortran (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
            Copyright (C) 2015 Free Software Foundation, Inc.

            GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
            You may redistribute copies of GNU Fortran
            under the terms of the GNU General Public License.
            For more information about these matters, see the file named COPYING

            It seems gfortran is trying to compile, and isn't, as I don't see any
            compiled file output.

            Best,

            Derek




            On 11/03/2016 01:26 PM, Brian Savage wrote:

            Derek,

            Try added sacio to the sac-config command

            % sac-config --libs sacio
            -L/usr/local/sac/lib -lsacio

            You only have the path and are missing the library.

            Brian

            On Nov 3, 2016, at 3:19 PM, Derek Schutt wrote:

            Hi,

            I'm trying unsuccessfully to compile a fortran program using the SAC
            provided i/o libraries, but I am getting an error message that is confusing
            me. I'm using sac 101.6a, and the libraries I need are at
            /usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib.

            *% gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
            `/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/bin/sac-config
            --cflags --libs
            --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib sacio" `*

            f951: Warning: Nonexistent include directory ‘/usr/local/sac/include’
            [-Wmissing-include-dirs]
            /tmp/ccLy95iX.o: In function `MAIN__':
            rdsetupsimul.1.brfix.f:(.text+0x1218): undefined reference to `rsac1_'
            rdsetupsimul.1.brfix.f:(.text+0x1265): undefined reference to `getfhv_'
            rdsetupsimul.1.brfix.f:(.text+0x12ae): undefined reference to `getfhv_'
            rdsetupsimul.1.brfix.f:(.text+0x12f7): undefined reference to `getfhv_'
            rdsetupsimul.1.brfix.f:(.text+0x1340): undefined reference to `getfhv_'
            rdsetupsimul.1.brfix.f:(.text+0x1389): undefined reference to `getfhv_'
            /tmp/ccLy95iX.o:rdsetupsimul.1.brfix.f:(.text+0x13d2): more undefined
            references to `getfhv_' follow
            /tmp/ccLy95iX.o: In function `MAIN__':
            rdsetupsimul.1.brfix.f:(.text+0x13fd): undefined reference to `getkhv_'
            collect2: error: ld returned 1 exit status

            I guess I don't understand why it is wanting regarding
            /usr/local/sac/include if I am giving it the prefix input.

            Note that this gives me what I expect:

            *% sac-config --libs
            --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib" *

            namely, what I input:

            -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib

            and I have confirmed this it the correct path to the libraries.


            Thanks,

            Derek


            ----------------------
            SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

            Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
            Update subscription preferences at http://ds.iris.edu/account/profile/




            ----------------------
            SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

            Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
            Update subscription preferences at http://ds.iris.edu/account/profile/



            ----------------------
            SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

            Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
            Update subscription preferences at http://ds.iris.edu/account/profile/





            ----------------------
            SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

            Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
            Update subscription preferences at http://ds.iris.edu/account/profile/



            ----------------------
            SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

            Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
            Update subscription preferences at http://ds.iris.edu/account/profile/


            • Thanks Rob, got it figured out with this advice.

              For completeness to the thread (in case it is useful for anyone), here's
              a version that seems to work with sac-config. It also outputs a -I
              flag to the location of the $SACHOME/include directory, but I don't need
              that for this code.

              *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config --cflags
              --libs sacio
              --prefix=/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib sacio`


              *
              On 11/03/2016 02:35 PM, Rob Porritt wrote:
              sac-config is supposed to be a shortcut to those library flags. You
              should be able to run sac-config stand-alone on the command line and
              see if it outputs the -L and -l flags properly.

              On Thu, Nov 3, 2016 at 1:31 PM Derek Schutt <schutt<at>colostate.edu
              <schutt<at>colostate.edu>> wrote:

              Thanks Brian

              That worked. So, was I using sac-config unnecessarily?

              On 11/03/2016 02:26 PM, Brian Savage wrote:
              Derek

              You want something like (without sac-config)

              *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
              -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio*

              -Lpath/to/lib
              -lsacio (the library)

              Brian

              On Nov 3, 2016, at 4:21 PM, Derek Schutt wrote:

              Thanks Brian,

              It's been ages since I've tried to compile code, so I may be
              doing something clueless here, but it seems that sac-config is
              choking. Based on (my misunderstanding of?) your advice, I've
              tried:

              *gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config -c
              -l sacio
              -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio `*

              and

              gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f `sac-config
              --cflags --libs sacio
              -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib -lsacio `

              In both cases,

              I get output that suggests to me that the me that sac-config is
              not happy with the input, because it is telling me the proper usage.

              Usage: sac-config [-clvp] [--prefix[=DIR]] [--version] [--libs]
              [--cflags] libs
              GNU Fortran (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)
              Copyright (C) 2015 Free Software Foundation, Inc.

              GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
              You may redistribute copies of GNU Fortran
              under the terms of the GNU General Public License.
              For more information about these matters, see the file named COPYING

              It seems gfortran is trying to compile, and isn't, as I don't
              see any compiled file output.

              Best,

              Derek




              On 11/03/2016 01:26 PM, Brian Savage wrote:
              Derek,

              Try added sacio to the sac-config command

              % sac-config --libs sacio
              -L/usr/local/sac/lib -lsacio

              You only have the path and are missing the library.

              Brian

              On Nov 3, 2016, at 3:19 PM, Derek Schutt wrote:

              Hi,

              I'm trying unsuccessfully to compile a fortran program using
              the SAC provided i/o libraries, but I am getting an error
              message that is confusing me. I'm using sac 101.6a, and the
              libraries I need are at
              /usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib.

              *% gfortran -o rdsetupsimul rdsetupsimul.1.brfix.f
              `/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/bin/sac-config
              --cflags --libs
              --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib
              sacio" `*

              f951: Warning: Nonexistent include directory
              ‘/usr/local/sac/include’ [-Wmissing-include-dirs]
              /tmp/ccLy95iX.o: In function `MAIN__':
              rdsetupsimul.1.brfix.f:(.text+0x1218): undefined reference to
              `rsac1_'
              rdsetupsimul.1.brfix.f:(.text+0x1265): undefined reference to
              `getfhv_'
              rdsetupsimul.1.brfix.f:(.text+0x12ae): undefined reference to
              `getfhv_'
              rdsetupsimul.1.brfix.f:(.text+0x12f7): undefined reference to
              `getfhv_'
              rdsetupsimul.1.brfix.f:(.text+0x1340): undefined reference to
              `getfhv_'
              rdsetupsimul.1.brfix.f:(.text+0x1389): undefined reference to
              `getfhv_'
              /tmp/ccLy95iX.o:rdsetupsimul.1.brfix.f:(.text+0x13d2): more
              undefined references to `getfhv_' follow
              /tmp/ccLy95iX.o: In function `MAIN__':
              rdsetupsimul.1.brfix.f:(.text+0x13fd): undefined reference to
              `getkhv_'
              collect2: error: ld returned 1 exit status

              I guess I don't understand why it is wanting regarding
              /usr/local/sac/include if I am giving it the prefix input.

              Note that this gives me what I expect:

              *% sac-config --libs
              --prefix="/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib"
              *

              namely, what I input:

              -L/usr2/OS-DEPENDENT/Linux_Generic_unknown/sac-101.6a/lib

              and I have confirmed this it the correct path to the libraries.


              Thanks,

              Derek



              ----------------------
              SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

              Sent from the IRIS Message Center
              (http://ds.iris.edu/message-center/)
              Update subscription preferences at
              http://ds.iris.edu/account/profile/



              ----------------------
              SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

              Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
              Update subscription preferences at http://ds.iris.edu/account/profile/


              ----------------------
              SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

              Sent from the IRIS Message Center
              (http://ds.iris.edu/message-center/)
              Update subscription preferences at
              http://ds.iris.edu/account/profile/



              ----------------------
              SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

              Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
              Update subscription preferences at http://ds.iris.edu/account/profile/


              ----------------------
              SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

              Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
              Update subscription preferences at http://ds.iris.edu/account/profile/



14:06:08 v.01697673