Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error with intel compiler #1683

Closed
avpanov opened this issue Jul 19, 2021 · 2 comments · Fixed by #1702
Closed

Compilation error with intel compiler #1683

avpanov opened this issue Jul 19, 2021 · 2 comments · Fixed by #1702

Comments

@avpanov
Copy link

avpanov commented Jul 19, 2021

With meep-1.19 Intel compiler stops with following:

--
CXX sphere-quad.o
CXXLD sphere_quad
CXX array_slice.lo
In file included from meep.hpp(25),
from meep_internals.hpp(20),
from array_slice.cpp(27):
meep/vec.hpp(306): warning #3497: standard attribute syntax is a C++11 feature
[[noreturn]] extern void abort(const char *, ...); // mympi.cpp
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(818): error: qualified name is not allowed
std::unique_ptr<binary_partition> bp;
^

In file included from meep_internals.hpp(20),
from #array_slice.cpp(27):
meep.hpp(818): error #77: this declaration has no storage class or type specifier
std::unique_ptr<binary_partition> bp;
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(818): error: expected a ";"
std::unique_ptr<binary_partition> bp;
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(822): error: namespace "std" has no member "unique_ptr"
std::unique_ptr<binary_partition> choose_chunkdivision(grid_volume &gv, volume &v, int num_chunks,
^
In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(822): error: expected a ";"
std::unique_ptr<binary_partition> choose_chunkdivision(grid_volume &gv, volume &v, int num_chunks,
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(1407): warning #3495: rvalue references are a C++11 feature
void add_source(field_type ft, src_vol &&src);
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(2183): error: namespace "std" has no member "unique_ptr"
binary_partition(const split_plane &_split_plane, std::unique_ptr<binary_partition> &&left_tree,
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(2183): error: expected a ")"
binary_partition(const split_plane &_split_plane, std::unique_ptr<binary_partition> &&left_tree,
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(2200): error: qualified name is not allowed
std::unique_ptr<binary_partition> left;
^

In file included from meep_internals.hpp(20),
from array_slice.cpp(27):
meep.hpp(2200): error #77: this declaration has no storage class or type specifier
std::unique_ptr<binary_partition> left;
^

This error was inintroduced after meep-1.18.
I tried versions intel-2017.2.174 and intel-2019.0.117 with -std=c++11 option.

@ahoenselaar
Copy link
Contributor

Several of the emitted warnings indicate that the compiler is not actually in C++11 mode.
How did you configure the build?
Furthermore, this post indicates that there are likely problems with the GCC libraries and headers used by the Intel compiler in your installation.

@avpanov
Copy link
Author

avpanov commented Jul 19, 2021

The switch "-std=c++11" was definitely added to CFLAGS and CXXFLAGS before running configure script. After digging I have found that CXXFLAGS inside Makefiles was set to just "-O3", probably from mpic++ installation (mvapich2). On editing Makefile inside src subdirectory, the compilation of meep 1.19 stopped here:

--
libtool: compile: mpic++ -DHAVE_CONFIG_H -I. -I.. -I../src -I/home/Safe/panov/intel/include/ -I/home/Safe/panov/irus17/include/ -I/home/Safe/panov/include/ -march=core-avx2 -mtune=broadwell -O3 -std=c++11 -fPIC -finline-functions -fno-fast-math -I/home/Safe/panov/intel/include -MT structure_dump.lo -MD -MP -MF .deps/structure_dump.Tpo -c structure_dump.cpp -fPIC -DPIC -o .libs/structure_dump.o
icpc: command line warning #10006: ignoring unknown option '-fno-fast-math'
structure_dump.cpp(427): error: no suitable conversion function from "const meep::split_plane" to "meep::direction" exists
binary_partition::binary_partition(const binary_partition& other) : proc_id{other.proc_id}, plane{other.plane} {
^

compilation aborted for structure_dump.cpp (code 2)
make[2]: *** [structure_dump.lo] Error 1

--

ahoenselaar added a commit to ahoenselaar/meep that referenced this issue Jul 26, 2021
stevengj added a commit that referenced this issue Jul 27, 2021
* Fix the `binary_partition` copy constructor.

Prevents issues with older compilers.
\#1683 #1701

* Update src/structure_dump.cpp

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Steven G. Johnson <[email protected]>
stevengj added a commit that referenced this issue Jul 30, 2021
* fix factor 2

* fix

* fix

* fix

* kpoint

* fix

* Fix the `binary_partition` copy constructor. (#1702)

* Fix the `binary_partition` copy constructor.

Prevents issues with older compilers.
\#1683 #1701

* Update src/structure_dump.cpp

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Steven G. Johnson <[email protected]>

* single precision test tol

* single precision test tol

* Fix factor of 2 in adjoint gradients when not using complex fields (#1704)

* fix factor 2

* fix

* fix

* fix

* single precision test tol

* single precision test tol

* Update python/adjoint/objective.py

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>

* assertVectorsClose works for scalars as well as vectors (#1712)

* assertVectorsClose works for scalars as well as vectors

* rename ApproxComparisonMixin -> ApproxComparisonTestCase, since it is a subclass of TestCase, and use it as such

* add --with-coverage to control usage of Python coverage tests (#1713)

* add --with-coverage to control usage of Python coverage tests

* move  --with-coverage  to correct CI line

* flush subnormals on x86 (#1709)

* flush subnormals on x86

* less aggressive error threshold in single precision

* increase single-precision tolerance

* update tols in test_array_metadata

* update for assertVectorsClose rename

* lower tolerance in single precision

* Lower tolerance of CW and eigenfrequency solver tests for single precision (#1714)

* lower tolerance of CW and eigenfrequency solver tests for single precision

* remove change in default argument from Python wrappers

* fix factor 2

* fix

* kpoint

* fix

* single precision test tol

* single precision test tol

* using real

* using real

* fix rebase

* fix

* fix

Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Andreas Hoenselaar <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Ardavan Oskooi <[email protected]>
bencbartlett pushed a commit to bencbartlett/meep that referenced this issue Sep 9, 2021
* Fix the `binary_partition` copy constructor.

Prevents issues with older compilers.
\NanoComp#1683 NanoComp#1701

* Update src/structure_dump.cpp

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Steven G. Johnson <[email protected]>
bencbartlett pushed a commit to bencbartlett/meep that referenced this issue Sep 9, 2021
* fix factor 2

* fix

* fix

* fix

* kpoint

* fix

* Fix the `binary_partition` copy constructor. (NanoComp#1702)

* Fix the `binary_partition` copy constructor.

Prevents issues with older compilers.
\NanoComp#1683 NanoComp#1701

* Update src/structure_dump.cpp

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Steven G. Johnson <[email protected]>

* single precision test tol

* single precision test tol

* Fix factor of 2 in adjoint gradients when not using complex fields (NanoComp#1704)

* fix factor 2

* fix

* fix

* fix

* single precision test tol

* single precision test tol

* Update python/adjoint/objective.py

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>

* assertVectorsClose works for scalars as well as vectors (NanoComp#1712)

* assertVectorsClose works for scalars as well as vectors

* rename ApproxComparisonMixin -> ApproxComparisonTestCase, since it is a subclass of TestCase, and use it as such

* add --with-coverage to control usage of Python coverage tests (NanoComp#1713)

* add --with-coverage to control usage of Python coverage tests

* move  --with-coverage  to correct CI line

* flush subnormals on x86 (NanoComp#1709)

* flush subnormals on x86

* less aggressive error threshold in single precision

* increase single-precision tolerance

* update tols in test_array_metadata

* update for assertVectorsClose rename

* lower tolerance in single precision

* Lower tolerance of CW and eigenfrequency solver tests for single precision (NanoComp#1714)

* lower tolerance of CW and eigenfrequency solver tests for single precision

* remove change in default argument from Python wrappers

* fix factor 2

* fix

* kpoint

* fix

* single precision test tol

* single precision test tol

* using real

* using real

* fix rebase

* fix

* fix

Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Andreas Hoenselaar <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Ardavan Oskooi <[email protected]>
mawc2019 pushed a commit to mawc2019/meep that referenced this issue Nov 3, 2021
* Fix the `binary_partition` copy constructor.

Prevents issues with older compilers.
\NanoComp#1683 NanoComp#1701

* Update src/structure_dump.cpp

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Steven G. Johnson <[email protected]>
mawc2019 pushed a commit to mawc2019/meep that referenced this issue Nov 3, 2021
* fix factor 2

* fix

* fix

* fix

* kpoint

* fix

* Fix the `binary_partition` copy constructor. (NanoComp#1702)

* Fix the `binary_partition` copy constructor.

Prevents issues with older compilers.
\NanoComp#1683 NanoComp#1701

* Update src/structure_dump.cpp

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Steven G. Johnson <[email protected]>

* single precision test tol

* single precision test tol

* Fix factor of 2 in adjoint gradients when not using complex fields (NanoComp#1704)

* fix factor 2

* fix

* fix

* fix

* single precision test tol

* single precision test tol

* Update python/adjoint/objective.py

Co-authored-by: Steven G. Johnson <[email protected]>

Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>

* assertVectorsClose works for scalars as well as vectors (NanoComp#1712)

* assertVectorsClose works for scalars as well as vectors

* rename ApproxComparisonMixin -> ApproxComparisonTestCase, since it is a subclass of TestCase, and use it as such

* add --with-coverage to control usage of Python coverage tests (NanoComp#1713)

* add --with-coverage to control usage of Python coverage tests

* move  --with-coverage  to correct CI line

* flush subnormals on x86 (NanoComp#1709)

* flush subnormals on x86

* less aggressive error threshold in single precision

* increase single-precision tolerance

* update tols in test_array_metadata

* update for assertVectorsClose rename

* lower tolerance in single precision

* Lower tolerance of CW and eigenfrequency solver tests for single precision (NanoComp#1714)

* lower tolerance of CW and eigenfrequency solver tests for single precision

* remove change in default argument from Python wrappers

* fix factor 2

* fix

* kpoint

* fix

* single precision test tol

* single precision test tol

* using real

* using real

* fix rebase

* fix

* fix

Co-authored-by: Mo Chen <[email protected]>
Co-authored-by: Andreas Hoenselaar <[email protected]>
Co-authored-by: Steven G. Johnson <[email protected]>
Co-authored-by: Ardavan Oskooi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants