I am getting this error when compiling a C++ program using the 17.5 version of the pgi compiler ( pgc++ 17.5-0 64-bit target on x86-64 Linux -tp sandybridge)
error: namespace “std” has no member “function”
The curious thing is that it compiles in some machines and fail to compile in others. I all the machines I am using the same pgi compiler.
In one of the computers where the code compiles has g++ (Debian 6.3.0-18) 6.3.0 20170516. Another one working fine has g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4).
In one of the failing computers has g++ (GCC) 6.2.0 installed.
Did you install the compilers as “single system install” ?
I suggest you first install the compilers using the “Network Install”.
Which will create a localrc.hostname file for each host that uses the
compilers, that properly finds where header/lib information that is missing can be found.
On each machine in the network install, you need to have a
‘local’ directory that you can create on each host.
I often use ‘/local/pgi/17.5/shared_objects’. This has the same
function as the /usr/lib directory has for finding libc.so on each
Linux machine, to dynamically link compatible libs for that Linux/g++ version.
On each new machine you wish to try the compilers on, you only
need to run
add_network_host
from the original installation, to make the new host’s g++
headers and libs accessible to pgc++.
Note: the pathname has to be one you have permission
to create on each host, or you will have to pre-create it manually.
You do not need root/superuser access.
You only need a local directory that can b created on each system.
You might try /tmp/pgi/17.5/shared_objects
which will be on every system - but you may lose the directory
from time to time. Just run ‘add_network_host’ again to recreate it.
But for a standard install, only that Linux and gcc version
you install on will work with the compilers after installation.
But the executable created should run other places if.
the gcc version you compile under is as old as the other machines.
the cpu type on your compile machine is as old or older than the
other machines. If not you will need to add
-tp=haswell
I was able to install the compiler using the network option. However I still have the same problem.
I have also trying to compile the program in the Blue Waters supercomputer, using the pgi compiler-environment they have installed there (pgi 16.9) and I am getting the same error.
“core/matrix.hpp”, line 138: error: namespace “std” has no member “function”
virtual void apply_func( std::function<void(int, int, double)> func_ptr) = 0;
The true is that the program compiles when it is compiled in an individual computer (not part of a network).
create test1.i on a system not on a network, and test2.i on a network,
and see what is different after the code is fully preprocessed. Could be a different header is causing the ‘std’ headaches. From there you need
to determine which header is appropriate to be using, and take steps
to avoid the other.
The compiler I am using is:
efblack2@g$ g++ --version g++ (GCC) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
The default compiler in this system is gcc 4.4.7.
At login I do a :
module unload gcc/4.7.1
module load gcc/6.2.0
However if I run this command:
AHA! This is a known issue.
cd $PGI/linux86-64/17.5/bin
chmod +x addlocalrc
./addlocalrc
as you run ‘addlocalrc’ is will look for any gcc version you have and
create a localrc.some_name for it. Keep track of the gcc version
you wish to run, say it is called
localrc.gcc62
I tried your procedure in in a couple of system with the same response. The localrc.xxx file is not created.
Probably the mos relevant piece of information from running addlocalrc is:
[efblack@g]$ ./addlocalrc
Usage: addlocalrc [release_dir]
The release_dir is defaulting to /home/efblack2/project-cse/pgi/linux86-64/17.5
Do you want to continue? (y/n)
This step of the installation process requires the locate command
which was not found. Quitting
./addlocalrc: line 45: quit: command not found
./addlocalrc: line 79: locate: command not found
ARCH=x86_64
BASH=/bin/sh
BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:sourcepath
.
.
.
.
.
No working gcc executables were found on this system
Exiting
./addlocalrc: line 86: quit: command not found