- [Why is it important]?
- What is your solution?
- What is one going to find after reading your paper?
- What's the system about?
- Results
extern int select();
int
usleep( usec ) /* returns 0 if ok, else -1 */
long usec; /* delay in microseconds */
{
static struct /* `timeval' */
{
long tv_sec; /* seconds */
long tv_usec; /* microsecs */
} delay; /* _select() timeout */
delay.tv_sec = usec / 1000000L;
delay.tv_usec = usec % 1000000L;
return select( 0, (long *)0, (long *)0, (long *)0, &delay );
}
awk '{s+=$0} END {print s}' /tmp/file.txt
paste -sd+ /tmp/file.txt | bc
Source: http://unstableme.blogspot.com/2009/11/sum-of-numbers-in-file-unix.html
undefined reference to `iargc_'undefined reference to `getarg_'
Solution: use '_gfortran_iargc()' and '_gfortran_getarg_i4()' instead of 'iargc_()' and 'getargc_()'. This is specific to the situation where you link C with Fortran.
On the cluster, these are defined in /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgfortran.a.
http://osdir.com/ml/gcc.fortran/2005-02/msg00297.html
http://old.nabble.com/getarg-and-iargc-in-gcc-4.0.2-td1803996.html
Other links on Fortran + C compilation:
http://www.fnal.gov/docs/UNIX/unix_a.../uatf-107.html
http://astro.berkeley.edu/~wright/f2c.html
http://www.yolinux.com/TUTORIALS/Lin...rtranAndC.html