on windows, functions of libbleu are not found
See original GitHub issueusing microsoft visual compiler 14.0, fairseq 0.5.0
building libbleu dll by calling python setup.py build develop
functions in pyd are only exposed if they are declared as __declspec(dllexport).
problem is fixed if declaration of all exported C++ functions are changed, e.g.
extern "C" {
__declspec(dllexport) void bleu_zero_init(bleu_stat* stat) {
std::memset(stat, 0, sizeof(bleu_stat));
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
on windows, functions of libbleu are not found · Issue #292
Let me elaborate more on the solution of @hollyhook. This issue is caused by the name changing problem during compiling. The compiler changed ......
Read more >Windows 10 Start and other functions not working.
Windows 10 Start and other functions not working. I have attempted all of the steps to get the Start menu to resume working...
Read more >Why Window Functions Are Not Allowed in WHERE Clauses
Window functions can only appear in SELECT and ORDER BY but not in WHERE clauses. The reason is the logical order in which...
Read more >Alias of window function field causing a "not found" error when ...
In this query, the reference to the row_num_alias field in the HAVING clause is causing the following error: Field 'row_num_alias' not found ......
Read more >Error in windows() function
This issue is being caused by a property called masking. There are two methods called windows() , one is available in base R...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Let me elaborate more on the solution of @hollyhook. This issue is caused by the name changing problem during compiling. The compiler changed the function name, and thereby we cannot find the function.
To solve the problem, you should add
__declspec(dllexport)
before the function declaration. In this line (fairseq/fairseq/clib/libbleu/libbleu.cpp file), add the__declspec(dllexport)
before functionvoid bleu_zero_init
,void bleu_one_init
, andvoid bleu_add
. Finally, call thepython setup.py build develop
, the problem would be fixed.I propose this should be re-opened. Requiring users to build your library from scratch is possible, but painful. I am not an expert at cross-compiling, but would it be as simple as conditionally adding the
__declspec
to the files inmaster
? I don’t know if that directive impacts Linux or OS X builds.