hpc 集群上的 libsnd 文件

libsnd file on hpc cluster

我已请求在 hpc 集群上安装 libsnd 文件。管理员说我可以通过以下 link:

进行测试

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'

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