c++ - Run c scrips from a shell script -


i have shell script

#!/bin/csh @ x = 1 while ($x <= 2) nohup ./prog1 && ./prog2 & @ x ++ end 

i want run sequentially 2 times prog1 , prog2 compiled trough makefile. how can it? script right?

if do

chmod u+x test.csh ./test.csh 

i error

./prog1: /usr/lib64/libstdc++.so.6: version `glibcxx_3.4.11' not found (required ./prog1) 

this makefile

gslflags := `pkg-config --cflags gsl`   libgsl := `pkg-config --libs gsl` cflags = -o3 -fopenmp libomp = -lgomp  dist.o:dist.cxx     g++ -wall -c dist.cxx  prog1.o:prog1.cxx     g++ -wall -c prog1.cxx  $< ${gslflags} ${cflags}  prog1:prog1.o dist.o      g++ ${cflags} -o  $@ $^ ${libgsl}   prog2.o:prog2.cxx     g++ -wall -c prog2.cxx  $< ${gslflags} ${cflags}  prog2:prog2.o dist.o      g++ ${cflags} -o  $@ $^ ${libgsl}  

it appears search path standard c++ library set differently in csh vs. when run command line.

linking standard libraries statically should make library search path irrelevant: change makefile follows:

cflags = -o3 -fopenmp -static-libgcc -static-libstdc++ 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -