V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  hhhhhh123  ›  全部回复第 1 页 / 共 4 页
回复总数  77
1  2  3  4  
4 天前
回复了 hhhhhh123 创建的主题 程序员 如何定义,初 中 高 级开发?
@echo314 soga
4 天前
回复了 hhhhhh123 创建的主题 程序员 如何定义,初 中 高 级开发?
@mazhiyuan 我也觉得是 看公司的划分制度
4 天前
回复了 hhhhhh123 创建的主题 程序员 如何定义,初 中 高 级开发?
@fengjianxinghun 这 可能是对 HR 招聘看的, 那我们自身应该如何去评价?
@vincent441 他好像是使用 sync 出了问题,然后推荐 gevent,eventlet 异步模式,我 sync 模式是完全 ok 的, 但是 gevent,eventlet 模式不行.
11 天前
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
解决了 extern "C" 我删掉了 忘记加上去了, 所以没有导出来, 加上后 重新编译 函数也能导出来了。
11 天前
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@yolee599 0000000000006710 T OMP_EVAL
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
U [email protected]_3.0
0000000000007c40 T _Z9benchmarkv
000000000000b460 T _ZN3omp13CombinedRange10joinRangesERKSt6vectorIS1_ISt5arrayIhLm2EESaIS3_EESaIS5_EEm
000000000000ad90 T _ZN3omp13CombinedRange7shuffleEv
000000000000ae90 T _ZN3omp13CombinedRangeC1EjRKSt6vectorISt5arrayIhLm2EESaIS3_EE
000000000000ad00 T _ZN3omp13CombinedRangeC1Ev
000000000000ae90 T _ZN3omp13CombinedRangeC2EjRKSt6vectorISt5arrayIhLm2EESaIS3_EE
000000000000ad00 T _ZN3omp13CombinedRangeC2Ev
0000000000014930 T _ZN3omp13HandEvaluator10staticInitEv
00000000000164c0 R _ZN3omp13HandEvaluator11FLUSH_RANKSE
0000000000026460 B _ZN3omp13HandEvaluator11ORIG_LOOKUPE
0000000000022460 B _ZN3omp13HandEvaluator12FLUSH_LOOKUPE
00000000000147f0 T _ZN3omp13HandEvaluator14populateLookupEmjjjjjjb



还有很多这样的 , 次数超过限制所有发不出来
11 天前
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@nifury @qbqbqbqb
@qbqbqbqb 我加了-fPIC 参数, 虽然能编译, 但是函数好像没有导出, 这个时候 应该怎么导出
11 天前
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@qbqbqbqb 我删除 extern "C" __declspec(dllexport) 这个了,但是出现了上面的错误, 你知道吗
11 天前
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
@nifury 你知道这个错误吗? 我吧 extern "C" __declspec(dllexport) 删掉了
11 天前
回复了 hhhhhh123 创建的主题 C c++ 在服务器上打包 so 文件问题
```
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/CardRange.o omp/CardRange.cpp
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/CombinedRange.o omp/CombinedRange.cpp
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/EquityCalculator.o omp/EquityCalculator.cpp
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/HandEvaluator.o omp/HandEvaluator.cpp
ar rcs lib/ompeval.a omp/CardRange.o omp/CombinedRange.o omp/EquityCalculator.o omp/HandEvaluator.o
g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -shared -o hongyu.so main.cpp benchmark.cpp lib/ompeval.a
/usr/bin/ld: lib/ompeval.a(HandEvaluator.o): warning: relocation against `_ZN3omp13HandEvaluator8cardInitE' in read-only section `.text.startup'
/usr/bin/ld: /tmp/ccUEKBa8.o: relocation R_X86_64_PC32 against symbol `[email protected]@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:25: hongyu] Error 1
```
11 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 请教一下,win 本地 make 能 ok , 但是在服务器就找不到一个文件, 这是没有指定路径还是啥?
main.cpp:1:10: fatal error: omp/EquityCalculator.h: No such file or directory
1 | #include <omp/EquityCalculator.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
11 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive gcc 都是最新的。 这不是源码吗? 应该是官方的吧
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive

In file included from omp/EquityCalculator.cpp:1:
omp/EquityCalculator.h:76:21: error: ‘std::function’ has not been declared
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~
omp/EquityCalculator.h:76:29: error: expected ‘,’ or ‘...’ before ‘<’ token
76 | std::function<void(const Results&)> callback = nullptr,
| ^
omp/EquityCalculator.h:202:10: error: ‘function’ in namespace ‘std’ does not name a template type
202 | std::function<void(const Results& results)> mCallback;
| ^~~~~~~~
omp/EquityCalculator.h:15:1: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
14 | #include <unordered_map>
+++ |+#include <functional>
15 | #include <array>
omp/EquityCalculator.h:76:16: error: default argument missing for parameter 6 of ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~~~~~~
omp/EquityCalculator.h:74:67: note: ...following parameter 2 which has a default argument
74 | bool start(const std::vector<CardRange>& handRanges, uint64_t boardCards = 0, uint64_t deadCards = 0,
| ~~~~~~~~~^~~~~~~~~~~~~~
omp/EquityCalculator.cpp:13:6: error: no declaration matches ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, std::function<void(const omp::EquityCalculator::Results&)>, double, unsigned int)’
13 | bool EquityCalculator::start(const std::vector<CardRange>& handRanges, uint64_t boardCards, uint64_t deadCards,
| ^~~~~~~~~~~~~~~~
In file included from omp/EquityCalculator.cpp:1:
omp/EquityCalculator.h:74:10: note: candidate is: ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’
74 | bool start(const std::vector<CardRange>& handRanges, uint64_t boardCards = 0, uint64_t deadCards = 0,
| ^~~~~
omp/EquityCalculator.h:22:7: note: ‘class omp::EquityCalculator’ defined here
22 | class EquityCalculator
| ^~~~~~~~~~~~~~~~
omp/EquityCalculator.cpp: In member function ‘void omp::EquityCalculator::updateResults(const omp::EquityCalculator::BatchResults&, bool)’:
omp/EquityCalculator.cpp:740:13: error: ‘mCallback’ was not declared in this scope
740 | if (mCallback)
| ^~~~~~~~~
make: *** [<builtin>: omp/EquityCalculator.o] Error 1
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 在上面写了
#ifndef _GLIBCXX_BITS_UNIFORM_INT_DIST_H
#define _GLIBCXX_BITS_UNIFORM_INT_DIST_H

#include <type_traits>
#include <ext/numeric_traits.h>
#if __cplusplus > 201703L
# include <concepts>
#endif
#include <bits/concept_check.h> // __glibcxx_function_requires
#include <functional>


但是错误好像还是这个
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 我不是 c++开发,是 python 开发
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 这是修改后的
__uctype __urngmin = _UniformRandomBitGenerator::min();
__uctype __urngmax = _UniformRandomBitGenerator::max();
assert( __urngmin < __urngmax);

报错信息变多了....

g++ -O3 -std=c++11 -Wall -Wpedantic -pthread -c -o omp/EquityCalculator.o omp/EquityCalculator.cpp
In file included from omp/EquityCalculator.cpp:1:
omp/EquityCalculator.h:76:21: error: ‘std::function’ has not been declared
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~
omp/EquityCalculator.h:76:29: error: expected ‘,’ or ‘...’ before ‘<’ token
76 | std::function<void(const Results&)> callback = nullptr,
| ^
omp/EquityCalculator.h:202:10: error: ‘function’ in namespace ‘std’ does not name a template type
202 | std::function<void(const Results& results)> mCallback;
| ^~~~~~~~
omp/EquityCalculator.h:15:1: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
14 | #include <unordered_map>
+++ |+#include <functional>
15 | #include <array>
omp/EquityCalculator.h:76:16: error: default argument missing for parameter 6 of ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’
76 | std::function<void(const Results&)> callback = nullptr,
| ^~~~~~~~~~~~~
omp/EquityCalculator.h:74:67: note: ...following parameter 2 which has a default argument
74 | bool start(const std::vector<CardRange>& handRanges, uint64_t boardCards = 0, uint64_t deadCards = 0,
| ~~~~~~~~~^~~~~~~~~~~~~~
omp/EquityCalculator.cpp:14:74: error: ‘std::function’ has not been declared
14 | bool enumerateAll, double stdevTarget, std::function<void(const Results&)> callback,
| ^~~~~~~~
omp/EquityCalculator.cpp:14:82: error: expected ‘,’ or ‘...’ before ‘<’ token
14 | bool enumerateAll, double stdevTarget, std::function<void(const Results&)> callback,
| ^
omp/EquityCalculator.cpp: In member function ‘bool omp::EquityCalculator::start(const std::vector<omp::CardRange>&, uint64_t, uint64_t, bool, double, int)’:
omp/EquityCalculator.cpp:47:5: error: ‘mCallback’ was not declared in this scope
47 | mCallback = callback;
| ^~~~~~~~~
omp/EquityCalculator.cpp:47:17: error: ‘callback’ was not declared in this scope; did you mean ‘calloc’?
47 | mCallback = callback;
| ^~~~~~~~
| calloc
omp/EquityCalculator.cpp:48:23: error: ‘updateInterval’ was not declared in this scope; did you mean ‘mUpdateInterval’?
48 | mUpdateInterval = updateInterval;
| ^~~~~~~~~~~~~~
| mUpdateInterval
omp/EquityCalculator.cpp:51:9: error: ‘threadCount’ was not declared in this scope
51 | if (threadCount == 0)
| ^~~~~~~~~~~
omp/EquityCalculator.cpp:53:26: error: ‘threadCount’ was not declared in this scope
53 | mUnfinishedThreads = threadCount;
| ^~~~~~~~~~~
omp/EquityCalculator.cpp: In member function ‘void omp::EquityCalculator::updateResults(const omp::EquityCalculator::BatchResults&, bool)’:
omp/EquityCalculator.cpp:740:13: error: ‘mCallback’ was not declared in this scope
740 | if (mCallback)
| ^~~~~~~~~
make: *** [<builtin>: omp/EquityCalculator.o] Error 1
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 好像还是不行, 弄了就出新的一堆错误
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive static_assert( __urngmin < __urngmax, "Uniform random bit generator must define min() < max()");

我删除 static_ 后 就是上面的报错
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 方法 1 成功解决一部分,但是方法 2 好像不行还是报错了 出现了两个新的错误
In file included from /usr/include/c++/11/bits/stl_algo.h:66,
from /usr/include/c++/11/algorithm:62,
from omp/CombinedRange.cpp:4:
/usr/include/c++/11/bits/uniform_int_dist.h:286:96: error: macro "assert" passed 2 arguments, but takes just 1
286 | assert( __urngmin < __urngmax, "Uniform random bit generator must define min() < max()");


niform_int_distribution<_IntType>::param_type&)’:
/usr/include/c++/11/bits/uniform_int_dist.h:286:9: error: ‘assert’ was not declared in this scope
286 | assert( __urngmin < __urngmax, "Uniform random bit generator must define min() < max()");
12 天前
回复了 hhhhhh123 创建的主题 C ubuntu /usr/include/c++/11/ 下的文件报错
@elfive 我是要 修改 /usr/include/c++/11/bits/uniform_int_dist 这些底层文件是吗? 修改后 会对其他代码编译什么的受影响吗
1  2  3  4  
关于   ·   帮助文档   ·   API   ·   FAQ   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2902 人在线   最高记录 5497   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 20ms · UTC 13:07 · PVG 21:07 · LAX 06:07 · JFK 09:07
Developed with CodeLauncher
♥ Do have faith in what you're doing.