error: namespace "std" has no member "functio

Hi all,

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.

What else should I look at?

Thanks in advance.

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.

dave

Thanks for the help.

I tried what you suggested, but it seems that you need super user privileges for that installation.

In the system I am having the problem I installed the compiler in one local (owned by me) directory.

In system in which the program compiles I have installed the compiler as super user, but also I have installed the compiler in a local directory.

Thanks any way.

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.

  1. the gcc version you compile under is as old as the other machines.
  2. 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

or something for a cpu all platforms can run.

dave

Hi Dave,

Thanks for your help.

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.

Here is an example of the error:

mpic++ -I/home/efblack2/spmv/pgi -I/home/efblack2/spmv/pgi/core -I/home/efblack2/spmv/pgi/gallery -c -std=c++11 -O3 -Minfo=all -Mvect=simd -DPGI -Mipa test.cpp

“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).

Thanks again,

Edgar

What version of gcc are you using? to use std=c++11 you need to
be 5.3 or newer.

One thing you might look at (or send to us) is

mpic++ -I/home/efblack2/spmv/pgi -I/home/efblack2/spmv/pgi/core -I/home/efblack2/spmv/pgi/gallery -E -DPGI test.cpp >& test1.i

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.

dave

dave

Hi Dave,

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:

[efblack@g~]$ makelocalrc /home/efblack2/project-cse/pgi/linux86-64/17.5/bin

/home/efblack/project-cse/pgi/linux86-64/17.5/bin/makelocalrc: line 749: /home/efblack/project-cse/pgi/linux86-64/17.5/glibc_version: Permission denied
PGI directory /home/efblack/project-cse/pgi/linux86-64
PGI version 17.5
PATH entry /home/efblack/project-cse/pgi/linux86-64/17.5/bin
System linker /lib64/ld-linux-x86-64.so.2
GCC directory /usr/lib/gcc/x86_64-redhat-linux/4.4.7
GCC 64bit headers /usr/local/gcc/6.2.0/include /usr/local/torque-releases/torque-6.0.2-1469811694_d9a3483/include /usr/local/include /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include /usr/include
GPP 64bit headers /usr/local/gcc/6.2.0/include /usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/…/include/c++/4.4.7 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/…/include/c++/4.4.7/x86_64-redhat-linux /usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/…/include/c++/4.4.7/backward /usr/local/include /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include /usr/include
G77 directory /usr/lib/gcc/x86_64-redhat-linux/4.4.7/
G77 headers -lgfortran
GCC version 4.4.7
GNU LIBC version 2.12
Threads /usr/lib64/libpthread.{a,so}
system libnuma.a exists
localrc exists and is the same

You can see that it still identify gcc 4.4.7 as the installed compiler.

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

export PGLOCALRC=/path/to/localrc.gcc62

and then try using the compilers.

dave

Dave,

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

Thanks for your time helping me.

Edgar

You need a Linux version with ‘locate’. I don’t have an alternative answer.

dave

Hi Dave,

Thank you for your time.
At least I know that is not me doing something silly.

Thanks again,

Edgar