【问题标题】:libsnd file on hpc clusterhpc 集群上的 libsnd 文件
【发布时间】:2020-04-12 16:03:26
【问题描述】:

我已要求我们在 hpc 集群上安装 libsnd 文件。管理员说我可以通过以下链接进行测试:

https://raw.githubusercontent.com/erikd/libsndfile/master/examples/sndfile-to-text.c

$ module load libsndfile/1.0.28 $ 
$ gcc -1/gpfs/apps/sw/libsndfile-1.0.28/include -L gpfs/apps/sw/libsndfile-1.0.28/lib, -lsndfile test.c 
$ ./a.out 

但是我还不知道怎么做!!我有一个程序 file.cpp 使用:

#include <sndfile.hh>

我尝试了以下方法:

module load -l/gpfs1/apps/sw/libsndfile-1.0.28/include -L/gpfs1/apps/sw/libsndfile-1.0.28/lib -lsndfile file.cpp

但出现以下错误:

getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'g'
getopt.c(1087):ERROR:45: Invalid option '1'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'w'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'b'
getopt.c(1087):ERROR:45: Invalid option 'n'
getopt.c(1087):ERROR:45: Invalid option 'd'
getopt.c(1087):ERROR:45: Invalid option 'e'
getopt.c(1087):ERROR:45: Invalid option '-'
getopt.c(1087):ERROR:45: Invalid option '1'
getopt.c(1087):ERROR:45: Invalid option '.'
getopt.c(1087):ERROR:45: Invalid option '0'
getopt.c(1087):ERROR:45: Invalid option '.'
getopt.c(1087):ERROR:45: Invalid option '2'
getopt.c(1087):ERROR:45: Invalid option '8'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'n'
cmdUlvl.c(206):ERROR:46: Undefined userlevel 'de'
getopt.c(1087):ERROR:45: Invalid option 'L'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'g'
getopt.c(1087):ERROR:45: Invalid option '1'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'w'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'b'
getopt.c(1087):ERROR:45: Invalid option 'n'
getopt.c(1087):ERROR:45: Invalid option 'd'
getopt.c(1087):ERROR:45: Invalid option 'e'
getopt.c(1087):ERROR:45: Invalid option '-'
getopt.c(1087):ERROR:45: Invalid option '1'
getopt.c(1087):ERROR:45: Invalid option '.'
getopt.c(1087):ERROR:45: Invalid option '0'
getopt.c(1087):ERROR:45: Invalid option '.'
getopt.c(1087):ERROR:45: Invalid option '2'
getopt.c(1087):ERROR:45: Invalid option '8'
getopt.c(1087):ERROR:45: Invalid option '/'
getopt.c(1087):ERROR:45: Invalid option 'b'
getopt.c(1087):ERROR:45: Invalid option 'n'
getopt.c(1087):ERROR:45: Invalid option 'd'
getopt.c(1087):ERROR:45: Invalid option 'e'
ModuleCmd_Load.c(204):ERROR:105: Unable to locate a modulefile for 'spectro.cpp'

【问题讨论】:

    标签: c++ compilation libsndfile environment-modules


    【解决方案1】:

    module 命令有助于定义环境变量。它无法编译程序,因此您运行的module load 命令以错误结束,因为module 不理解您的请求。

    libsndfile/1.0.28 模块文件应该为编译定义有用的变量,例如LD_LIBRARY_PATH。您可以检查模块文件定义的环境变量:

    $ module display libsndfile/1.0.28
    

    如果libsndfile/1.0.28 模块文件定义了环境变量以简化编译设置(通过定义包含路径和库路径),您可能只需要键入:

    $ module load 
    $ gcc -lsndfile test.c 
    $ ./a.out
    

    【讨论】:

      猜你喜欢
      • 2019-12-23
      • 2015-01-07
      • 2017-12-02
      • 2016-09-10
      • 2017-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      相关资源
      最近更新 更多