question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation error: expected primary-expression before token

See original GitHub issue

I’m packaging pytorch_sparse for NixOS.

Bug description

Version: revision 2eff407270c271424ecaf6b8fbcaa7dc1564ffac (current master HEAD atm) When building I get many errors such as this one:

/build/pytorch_sparse-2eff407/csrc/cpu/spspmm_cpu.cpp:90:62: error: expected primary-expression before ‘>’ token
   90 |         valC_data = optional_valueC.value().data_ptr<scalar_t>();
      |                                                              ^

Investigations

Could be an issue in my build setup but I don’t have much knowledge about this issue with gcc.

Seems related to this:

More

For the record:

torch-sparse-cuda = super.buildPythonPackage rec {
        pname = "torch_sparse";
        version = "0.6.0+cuda";

        doCheck = false;

        src = pkgs.fetchgit {
          url = "https://github.com/rusty1s/pytorch_sparse";
          rev = "2eff407270c271424ecaf6b8fbcaa7dc1564ffac";
          sha256 = "1cpjwkxlah0xrv9gv4m3bmm837zv3x5lxqdp4b90nb0am4zf8dsh";
        };

        nativeBuildInputs = with pkgs; [
          which
          gcc
        ];

        buildInputs = with super; [
          pytestrunner
        ];

        propagatedBuildInputs = with super; [
          pytorch
        ];
      };

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
mathermcommented, Jun 12, 2020

I just had the same problem and resolved it by upgrading pytorch to 1.5.0.

conda install -c pytorch pytorch
export CUDA=cu92 # cuda 9.2. in my case
pip install torch-scatter==latest+${CUDA} torch-sparse==latest+${CUDA} -f https://pytorch-geometric.com/whl/torch-1.5.0.html
0reactions
github-actions[bot]commented, Sep 16, 2021

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?

Read more comments on GitHub >

github_iconTop Results From Across the Web

error: expected primary-expression before ')' token (C)
I have tried to remove the argument 'SelectionneNonSelectionne', I obviously have the error message too few arguments, like this: error: too few ...
Read more >
Expected Primary Expression Before: Fixing the Warning
The “expected primary expression before int” error means that you are trying to declare a variable of int data type in the wrong...
Read more >
Cpp Common Compiler Errors with Explanations
List of the most common C++ errors students experience in Mimir Classroom and their explanations. ... expected primary-expression before ')' token.
Read more >
expected primary-expression before ':' token : r/arduino - Reddit
So I'm trying to write this script for something and I cannot for the life of me figure out why it's throwing these...
Read more >
Expected primary-expression before ')' token - Blynk Community
the rainbow function expects an argument to work. there is no variable passed to that function, this is why it gives that error....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found