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

Getting errors related to the uint64_t type #117

Open
odarbelaeze opened this issue Aug 27, 2024 · 0 comments
Open

Getting errors related to the uint64_t type #117

odarbelaeze opened this issue Aug 27, 2024 · 0 comments

Comments

@odarbelaeze
Copy link
Contributor

Hi,

I'm getting this error when trying to compile the code in serial mode using gcc 14.x,

In file included from ./hdr/create.hpp:55,
                 from ./hdr/exchange.hpp:20,
                 from ./hdr/atoms.hpp:31,
                 from src/simulate/LLGHeun.cpp:55:
./hdr/create_atoms_class.hpp:32:4: error: 'uint64_t' does not name a type
   32 |    uint64_t uc_id;        // atom number of host unit cell
      |    ^~~~~~~~
./hdr/create_atoms_class.hpp:1:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | //-----------------------------------------------------------------------------

Here's the version of gcc:

$ gcc --version
gcc (GCC) 14.2.1 20240805
Copyright (C) 2024 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 issue seems to go away if I apply the following diff:

diff --git a/hdr/create_atoms_class.hpp b/hdr/create_atoms_class.hpp
index ec4c748..66a3278 100644
--- a/hdr/create_atoms_class.hpp
+++ b/hdr/create_atoms_class.hpp
@@ -13,6 +13,8 @@
 #ifndef CREATE_ATOMS_CLASS_H_
 #define CREATE_ATOMS_CLASS_H_
 
+#include <cstdint>
+
 //namespace create{
 namespace cs{
 
diff --git a/hdr/dipole.hpp b/hdr/dipole.hpp
index 8aeaf0b..4a16f5e 100644
--- a/hdr/dipole.hpp
+++ b/hdr/dipole.hpp
@@ -14,6 +14,7 @@
 // C++ standard library headers
 #include <string>
 #include <vector>
+#include <cstdint>
 
 // Vampire headers
 #include "dipole.hpp"

Should I PR these changes? Or would it break the compilation for older versions of GCC?

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

No branches or pull requests

1 participant